Author: mattip Branch: windows-no-err-dlg Changeset: r50772:f01058ed1577 Date: 2011-12-20 21:59 +0200 http://bitbucket.org/pypy/pypy/changeset/f01058ed1577/
Log: prevent windows testrunner from opening system error dialog boxes diff --git a/testrunner/runner.py b/testrunner/runner.py --- a/testrunner/runner.py +++ b/testrunner/runner.py @@ -21,7 +21,17 @@ win32api.CloseHandle(proch) except pywintypes.error, e: pass - + #Try to avoid opeing a dialog box if one of the tests causes a system error + import ctypes + winapi = ctypes.windll.kernel32 + SEM_FAILCRITICALERRORS = 1 + SEM_NOGPFAULTERRORBOX = 2 + SEM_NOOPENFILEERRORBOX = 0x8000 + flags = SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX + #Since there is no GetErrorMode, do a double Set + old_mode = winapi.SetErrorMode(flags) + winapi.SetErrorMode(old_mode | flags) + SIGKILL = SIGTERM = 0 READ_MODE = 'rU' WRITE_MODE = 'wb' _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit