nvda
5795e76c - Python 3.8/liblouis helper: add NVDA executable path by calling os.add_dll_directory (#12020)

Commit
4 years ago
Python 3.8/liblouis helper: add NVDA executable path by calling os.add_dll_directory (#12020) * Louis helper: update copyright header * Louis helper/Python 3.8: call os.add_dll_directory when importing libluis DLL. Python 3.8 adds os.add_dll_directory to securely load DLL's from known locations, which affects Louis helper when trying to load liblouis.dll from NVDA executable folder. Therefore add NVDA executable path to known DLL directories through os.add_dll_directory, which resolves ModuleNotFoundError. * Louis helper: remove header comment, use globalVars.appDir as executable path. Reviewed by Lukasz Golonka: remove file name from header comment. Also, because __file__ will point to library.zip, use globalVars.appDir to locate NVDA executable where liblouis.dll actually resides. * Louis helper: use globalVars.appDir directly rather than going through os.path.dirname. Pointed out by Lukasz Golonka: globalVars.appDir records the actual path to the executable, including in source code version (nvda.pyw). Therefore use app dir directly.
Author
Parents
Loading