We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d1c7266 commit 18c8735Copy full SHA for 18c8735
1 file changed
tools/run_examples.py
@@ -14,6 +14,7 @@
14
15
import importlib
16
import os
17
+import subprocess
18
import sys
19
20
@@ -189,9 +190,10 @@ def check_installed_packages():
189
190
def check_gi_installed():
191
# Cannot import both gtk and gi in the same script, thus
192
# need another way of checking if gi package is installed.
- command = ("\"{python}\" -c \"import gi\""
193
- .format(python=sys.executable))
194
- code = os.system(command)
+ code = subprocess.call([sys.executable, "-c", "import gi"])
+ if code != 0:
195
+ print("[run_examples.py] gi module not found (PyGI / GTK 3).")
196
+ print(" Import error above can be safely ignored.")
197
return True if code == 0 else False
198
199
0 commit comments