Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e846342f
Commit
e846342f
authored
Mar 07, 2013
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#11732: make suppress_crash_popup() work on Windows XP and Windows Server 2003.
parent
7d82c862
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
Lib/test/support.py
Lib/test/support.py
+3
-1
No files found.
Lib/test/support.py
View file @
e846342f
...
@@ -1911,10 +1911,12 @@ if sys.platform.startswith('win'):
...
@@ -1911,10 +1911,12 @@ if sys.platform.startswith('win'):
def
suppress_crash_popup
():
def
suppress_crash_popup
():
"""Disable Windows Error Reporting dialogs using SetErrorMode."""
"""Disable Windows Error Reporting dialogs using SetErrorMode."""
# see http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621%28v=vs.85%29.aspx
# 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
import
ctypes
k32
=
ctypes
.
windll
.
kernel32
k32
=
ctypes
.
windll
.
kernel32
old_error_mode
=
k32
.
GetErrorMode
()
SEM_NOGPFAULTERRORBOX
=
0x02
SEM_NOGPFAULTERRORBOX
=
0x02
old_error_mode
=
k32
.
SetErrorMode
(
SEM_NOGPFAULTERRORBOX
)
k32
.
SetErrorMode
(
old_error_mode
|
SEM_NOGPFAULTERRORBOX
)
k32
.
SetErrorMode
(
old_error_mode
|
SEM_NOGPFAULTERRORBOX
)
try
:
try
:
yield
yield
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment