2021-05-05 00:39:52 +00:00
|
|
|
#! /usr/bin/env python3
|
|
|
|
|
2022-04-25 07:28:44 +00:00
|
|
|
import os
|
2021-05-05 00:39:52 +00:00
|
|
|
import sys
|
2022-04-25 07:28:44 +00:00
|
|
|
|
|
|
|
# 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'):
|
2022-04-26 03:19:16 +00:00
|
|
|
paths = reversed(os.environ['PATH'].split(os.pathsep))
|
2022-04-25 07:28:44 +00:00
|
|
|
for path in paths:
|
|
|
|
if path != '' and os.path.isdir(path):
|
|
|
|
os.add_dll_directory(path)
|
|
|
|
|
2022-12-20 02:18:16 +00:00
|
|
|
try:
|
|
|
|
import gi
|
|
|
|
except ImportError:
|
|
|
|
sys.exit(77) # skip this test, gi module is not available
|
2021-05-05 00:39:52 +00:00
|
|
|
|
|
|
|
gi.require_version('Gtk', '4.0')
|
|
|
|
|
|
|
|
from gi.repository import Gtk
|
|
|
|
|
|
|
|
assert isinstance(Gtk.INVALID_LIST_POSITION, int), 'Gtk.INVALID_LIST_POSITION is not an int'
|