Author: mattip <[email protected]>
Branch: 
Changeset: r63274:a3a2da007295
Date: 2013-04-12 13:41 +0300
http://bitbucket.org/pypy/pypy/changeset/a3a2da007295/

Log:    do not open dialog box on segfault in windows

diff --git a/pypy/module/cpyext/test/test_cpyext.py 
b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -1,6 +1,6 @@
 import sys
 import weakref
-import os.path
+import os
 
 import py
 
@@ -19,6 +19,14 @@
 from rpython.tool.identity_dict import identity_dict
 from rpython.tool import leakfinder
 
+if os.name == 'nt':
+    # Do not open dreaded dialog box on segfault
+    import ctypes
+    SEM_NOGPFAULTERRORBOX = 0x0002 # From MSDN
+    old_err_mode = ctypes.windll.kernel32.GetErrorMode()
+    new_err_mode = old_err_mode | SEM_NOGPFAULTERRORBOX
+    ctypes.windll.kernel32.SetErrorMode(new_err_mode)
+
 @api.cpython_api([], api.PyObject)
 def PyPy_Crash1(space):
     1/0
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to