mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
python: fix issue with bindings loading on Python 3.8
This commit is contained in:
parent
e47f3e5bcc
commit
4ec4ec844f
@ -68,6 +68,13 @@ def bootstrap():
|
||||
sys.path.insert(1, p)
|
||||
|
||||
if os.name == 'nt':
|
||||
if sys.version_info[:2] >= (3, 8): # https://github.com/python/cpython/pull/12302
|
||||
for p in l_vars['BINARIES_PATHS']:
|
||||
try:
|
||||
os.add_dll_directory(p)
|
||||
except Exception as e:
|
||||
if DEBUG: print('Failed os.add_dll_directory(): '+ str(e))
|
||||
pass
|
||||
os.environ['PATH'] = ';'.join(l_vars['BINARIES_PATHS']) + ';' + os.environ.get('PATH', '')
|
||||
if DEBUG: print('OpenCV loader: PATH={}'.format(str(os.environ['PATH'])))
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user