Maybe fixing ut_runner errors on MSVC

This commit is contained in:
Matthias Koefferlein 2023-03-28 00:11:34 +02:00
parent ed20ced941
commit 5c57f5ddf8
1 changed files with 13 additions and 0 deletions

View File

@ -326,6 +326,19 @@ PythonInterpreter::PythonInterpreter (bool embedded)
tl::warn << tl::to_string (tr ("Unable to find built-in Python module library path"));
}
// Supply a DLL load path for certain Python versions and on Windows
define_variable ("__klayout_dll_path", tl::dirname (app_path));
// NOTE: there is no API I know of ...
eval_string (
"import os\n"
"try:\n"
" global __klayout_dll_path\n"
" os.add_dll_directory(__klayout_dll_path)\n"
"except:\n"
" pass\n" // on Windows or older versions of Python
);
// Import the pya module
PyObject *pya_module = PyImport_ImportModule (pya_module_name);
if (pya_module == NULL) {
check_error ();