summaryrefslogtreecommitdiffstats
path: root/Lib/test/support.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-07 16:38:45 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-07 16:38:45 (GMT)
commit1181a46e09abc553b840fc4be23681a6b4e81bc7 (patch)
treea03fee523f6782407e08e853f3a8647d6234b041 /Lib/test/support.py
parent90c91afd2e2f8f52c9ac53acd09e732b1da42406 (diff)
parente846342f8ada25055fe1b9bcec407fe82e2c3f8e (diff)
downloadcpython-1181a46e09abc553b840fc4be23681a6b4e81bc7.zip
cpython-1181a46e09abc553b840fc4be23681a6b4e81bc7.tar.gz
cpython-1181a46e09abc553b840fc4be23681a6b4e81bc7.tar.bz2
#11732: merge with 3.3.
Diffstat (limited to 'Lib/test/support.py')
-rw-r--r--Lib/test/support.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/support.py b/Lib/test/support.py
index 00b3664..e6724a8 100644
--- a/Lib/test/support.py
+++ b/Lib/test/support.py
@@ -1913,10 +1913,12 @@ if sys.platform.startswith('win'):
def suppress_crash_popup():
"""Disable Windows Error Reporting dialogs using SetErrorMode."""
# see http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621%28v=vs.85%29.aspx
+ # GetErrorMode is not available on Windows XP and Windows Server 2003,
+ # but SetErrorMode returns the previous value, so we can use that
import ctypes
k32 = ctypes.windll.kernel32
- old_error_mode = k32.GetErrorMode()
SEM_NOGPFAULTERRORBOX = 0x02
+ old_error_mode = k32.SetErrorMode(SEM_NOGPFAULTERRORBOX)
k32.SetErrorMode(old_error_mode | SEM_NOGPFAULTERRORBOX)
try:
yield