Skip to content

Importing qt_compat when no Qt binding is installed fails with NameError instead of ImportError #11629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anntzer opened this issue Jul 11, 2018 · 1 comment
Labels
GUI: Qt Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Milestone

Comments

@anntzer
Copy link
Contributor

anntzer commented Jul 11, 2018

Bug report

Bug summary

See title.

Code for reproduction

In a clean venv with matplotlib (HEAD) installed and no qt binding installed, import matplotlib.backends.qt_compat.

Actual outcome

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/antony/src/extern/matplotlib/lib/matplotlib/backends/qt_compat.py", line 197, in <module>
    QtCore.Signal = QtCore.pyqtSignal
NameError: name 'QtCore' is not defined

Expected outcome

An ImportError.

Matplotlib version

  • Operating system:
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version:
  • Jupyter version (if applicable):
  • Other libraries:

Introduced by #11500 (I think).
#9993 fixes the issue and is ready to go.

@anntzer anntzer added Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. GUI: Qt labels Jul 11, 2018
@anntzer anntzer added this to the v3.0 milestone Jul 11, 2018
@tacaswell
Copy link
Member

fixed by #9993 which has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI: Qt Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

No branches or pull requests

2 participants