Skip to content
Snippets Groups Projects
Commit cff81a2a authored by Alexandre Detiste's avatar Alexandre Detiste
Browse files

properly detect python3-gi

parent 82425308
No related branches found
No related tags found
No related merge requests found
Pipeline #853306 failed
matplotlib (3.10.1+dfsg1-3) unstable; urgency=medium
[ James Addison ]
* Properly detect python3-gi absence/presence (Closes: #1101565)
-- Alexandre Detiste <tchet@debian.org> Sat, 19 Apr 2025 17:28:04 +0200
matplotlib (3.10.1+dfsg1-2) unstable; urgency=medium
* Release to unstable
......
From: James Addison <jay@jp-hosting.net>
Date: Tue, 01 Apr 2025 09:17:28 +0000
Subject: Raise import error if PyGObject module is empty
.
When GI overrides are installed, the dist-packages/gi directory is
non-empty, and this allows Python3 to import the module. This can
happen when Debian packages other than python3-gi are installed.
.
Detect an empty __file__ attribute on the imported module to check
whether it is genuinely the expected GObject Python module.
.
Credit to Francesco Ballarin for the test condition in #1101565.
Bug: http://bugs.debian.org/1101565
---
--- a/lib/matplotlib/backends/backend_gtk3.py
+++ b/lib/matplotlib/backends/backend_gtk3.py
@@ -11,6 +11,9 @@
try:
import gi
+
+ if gi.__file__ is None:
+ raise ImportError("Error: PyGObject module is empty")
except ImportError as err:
raise ImportError("The GTK3 backends require PyGObject") from err
--- a/lib/matplotlib/backends/backend_gtk4.py
+++ b/lib/matplotlib/backends/backend_gtk4.py
@@ -10,6 +10,9 @@
try:
import gi
+
+ if gi.__file__ is None:
+ raise ImportError("Error: PyGObject module is empty")
except ImportError as err:
raise ImportError("The GTK4 backends require PyGObject") from err
......@@ -11,3 +11,4 @@ fix-test_compressed_suptitle.patch
drop-sphinx-unpackaged-exts.patch
do-not-install-pfb.patch
fix-auto-backend-case-sensitivity.patch
fix-gi-import-empty-module.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment