summaryrefslogtreecommitdiff
path: root/testsuite/introspection/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/introspection/api.py')
-rwxr-xr-xtestsuite/introspection/api.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/testsuite/introspection/api.py b/testsuite/introspection/api.py
index c35b2b7448..a0afd6be57 100755
--- a/testsuite/introspection/api.py
+++ b/testsuite/introspection/api.py
@@ -1,6 +1,19 @@
#! /usr/bin/env python3
+import os
import sys
+
+# Python 3.8.x or later on Windows require os.add_dll_directory()
+# to be called on every directory that contains the required
+# non-bundled, non-system DLLs of a module so that the module can
+# be loaded successfully by Python. Make things easiler for people
+# by calling os.add_dll_directory() on the valid paths in %PATH%.
+if hasattr(os, 'add_dll_directory'):
+ paths = os.environ['PATH'].split(os.pathsep)
+ for path in paths:
+ if path != '' and os.path.isdir(path):
+ os.add_dll_directory(path)
+
import gi
gi.require_version('Gtk', '4.0')