Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 918f7ee

Browse files
committed
fix import warning
1 parent 4c817b8 commit 918f7ee

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
# :raises ValueError: If module/version is already loaded, already
1919
# required, or unavailable.
2020
gi.require_version("Gtk", "3.0")
21+
# Also require GioUnix to avoid PyGIWarning when Gio is imported
22+
gi.require_version("GioUnix", "2.0")
2123
except ValueError as e:
2224
# in this case we want to re-raise as ImportError so the
2325
# auto-backend selection logic correctly skips.

lib/matplotlib/backends/backend_gtk4.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
# :raises ValueError: If module/version is already loaded, already
1818
# required, or unavailable.
1919
gi.require_version("Gtk", "4.0")
20+
# Also require GioUnix to avoid PyGIWarning when Gio is imported
21+
gi.require_version("GioUnix", "2.0")
2022
except ValueError as e:
2123
# in this case we want to re-raise as ImportError so the
2224
# auto-backend selection logic correctly skips.

0 commit comments

Comments
 (0)