Skip to content

Can't catch PythonQtError #170

@astrofrog

Description

@astrofrog

I want to do something like:

try:
    import QtPy
except ImportError:
    pass

and have this also catch the case where PyQt5 or PySide aren't installed. However, in those cases the exception is PythonQtError rather than ImportError. However, I can't catch PythonQtError because I can't do from qtpy import PythonQtError since QtPy won't import...

Since I don't watch to just catch Exception, could PythonQtError be made a subclass of ImportError?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions