Skip to content

disable python "Caught the following exception:" window in Macro Development #85

@lukasc-ubc

Description

@lukasc-ubc

Hi @klayoutmatthias,

This question is regarding handling try/except cases in python modules loaded in KLayout.

On MacOS (I haven't checked on Windows), when a module is within the KLayout python folder, e.g., urllib3 in ~/.klayout/python/urllib3, and when you run a macro that uses that module, with the Macro Development window open, each try/except creates exceptions which pop up a GUI:

Caught the following exception:
....
Press 'Ok' to continue and 'Cancel' to stop in the debugger

However, if that module is installed in the system, e.g., pip install urllib3, then the same exceptions don't trigger the GUI.

And with the Macro Development window closed, you don't see these message and everything works fine.

What this means is that for modules that I develop and put in the KLayout path, I need to minimize the use of try/except, otherwise it makes debugging difficult (if you have to click "OK" 20 times before you get to the actual error you want to debug).

Is there any way to selectively disable the try/except dialogs for specific modules, or perhaps placing them in folders (salt/...) so they don't have these messages?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions