From: Chun-wei Fan Date: Tue, 26 Apr 2022 03:19:16 +0000 (+0800) Subject: Introspection test: Reverse os.add_dll_directory() order X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~4^2~231^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=65a7df47f20913caa6b051e19b558ebcad4fe083;p=gtk4.git Introspection test: Reverse os.add_dll_directory() order It looks like os.add_dll_directory() works in a LIFO order, so we call os.add_dll_directory() from the end of the list of directories in %PATH% so that the directories are searched in the correct order. --- diff --git a/testsuite/introspection/api.py b/testsuite/introspection/api.py index a0afd6be57..a2feac37ea 100755 --- a/testsuite/introspection/api.py +++ b/testsuite/introspection/api.py @@ -9,7 +9,7 @@ import sys # 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) + paths = reversed(os.environ['PATH'].split(os.pathsep)) for path in paths: if path != '' and os.path.isdir(path): os.add_dll_directory(path)