Skip to content

Commit 3b8b928

Browse files
committed
Suppress missing dll warnings on windows
1 parent 71c38ca commit 3b8b928

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arrayfire/library.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ def load_backend(name):
2222
elif platform_name == "Windows" or platform_name[:3] == "CYG":
2323
libname += '.dll'
2424
libname = libname[3:] # remove 'lib'
25+
if platform_name == "Windows":
26+
'''
27+
Supressing crashes caused by missing dlls
28+
http://stackoverflow.com/questions/8347266/missing-dll-print-message-instead-of-launching-a-popup
29+
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680621.aspx
30+
'''
31+
ct.windll.kernel32.SetErrorMode(0x0001 | 0x0002);
2532
else:
2633
raise OSError(platform_name + ' not supported')
2734

0 commit comments

Comments
 (0)