File: examples-Explicitly-tell-PyGI-which-version-of-Gom-to-imp.patch

package info (click to toggle)
libgom 0.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 804 kB
  • sloc: ansic: 9,784; python: 75; javascript: 50; sh: 33; makefile: 16
file content (31 lines) | stat: -rw-r--r-- 872 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Simon McVittie <smcv@debian.org>
Date: Sun, 7 Sep 2025 17:51:36 +0100
Subject: examples: Explicitly tell PyGI which version of Gom to import

This avoids a warning: `Gom was imported without specifying a
version first.`, etc.

Signed-off-by: Simon McVittie <smcv@debian.org>
Forwarded: https://gitlab.gnome.org/GNOME/gom/-/merge_requests/20
---
 examples/gom.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/examples/gom.py b/examples/gom.py
index 1e4ce9f..1226096 100755
--- a/examples/gom.py
+++ b/examples/gom.py
@@ -1,10 +1,12 @@
 #!/usr/bin/python3
 
 
+import gi
 from gi.types import GObjectMeta
 from gi.repository import GLib
 from gi.repository import GObject
-from gi.repository import Gom
+gi.require_version('Gom', '1.0')
+from gi.repository import Gom   # noqa
 
 
 # Need a metaclass until we get something like _gclass_init_