summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2020-04-09 21:51:42 +0200
committerStefan Behnel <stefan_ml@behnel.de>2020-04-09 21:51:42 +0200
commitd3b07d681777d57f90e09bf2cfbbb6583f4c8e16 (patch)
tree90194a896e8afd63606a45961ae06384167b5146
parentdb0361e668cf0148aa0fe5a20ccdd17f75a9069f (diff)
downloadcython-fix_srctree_tests_on_windows.tar.gz
Try to fix cython.inline() on Windows with Py3.8+ where the DLL loading requires an explicit registration of the extension output directory.fix_srctree_tests_on_windows
-rw-r--r--Cython/Build/Inline.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Cython/Build/Inline.py b/Cython/Build/Inline.py
index 5257ada18..9876d268d 100644
--- a/Cython/Build/Inline.py
+++ b/Cython/Build/Inline.py
@@ -261,6 +261,13 @@ def __invoke(%(params)s):
build_extension.build_lib = lib_dir
build_extension.run()
+ try:
+ add_dll_directory = os.add_dll_directory
+ except AttributeError:
+ pass
+ else:
+ add_dll_directory(os.path.dirname(module_path))
+
module = load_dynamic(module_name, module_path)
_cython_inline_cache[orig_code, arg_sigs, key_hash] = module.__invoke