Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 61ed3f4

Browse filesBrowse files
authored
Merge pull request #25636 from QuLogic/import-message
Ensure ImportError's have a message
2 parents 6686f97 + b88a683 commit 61ed3f4
Copy full SHA for 61ed3f4

File tree

3 files changed

+4
-3
lines changed
Filter options

3 files changed

+4
-3
lines changed

‎lib/matplotlib/backends/backend_cairo.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_cairo.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
try:
1616
import cairo
1717
if cairo.version_info < (1, 14, 0): # Introduced set_device_scale.
18-
raise ImportError
18+
raise ImportError(f"Cairo backend requires cairo>=1.14.0, "
19+
f"but only {cairo.version_info} is available")
1920
except ImportError:
2021
try:
2122
import cairocffi as cairo

‎lib/matplotlib/backends/backend_gtk3.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_gtk3.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
except ValueError as e:
2222
# in this case we want to re-raise as ImportError so the
2323
# auto-backend selection logic correctly skips.
24-
raise ImportError from e
24+
raise ImportError(e) from e
2525

2626
from gi.repository import Gio, GLib, GObject, Gtk, Gdk
2727
from . import _backend_gtk

‎lib/matplotlib/backends/backend_gtk4.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_gtk4.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
except ValueError as e:
2121
# in this case we want to re-raise as ImportError so the
2222
# auto-backend selection logic correctly skips.
23-
raise ImportError from e
23+
raise ImportError(e) from e
2424

2525
from gi.repository import Gio, GLib, Gtk, Gdk, GdkPixbuf
2626
from . import _backend_gtk

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.