Skip to content

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

@anntzer

Description

@anntzer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUI: QtRelease criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy