Mercurial > ~astiob > upreckon > hgweb
comparison testcases.py @ 72:7520b6bb6636
Windows Error Reporting is now suppressed (at least the dialogs)
| author | Oleg Oshmyan <chortos@inbox.lv> |
|---|---|
| date | Thu, 06 Jan 2011 17:51:59 +0200 |
| parents | 1bee3a0beeb5 |
| children | 0e5ae28e0b2b |
comparison
equal
deleted
inserted
replaced
| 71:1bee3a0beeb5 | 72:7520b6bb6636 |
|---|---|
| 34 try: | 34 try: |
| 35 import ctypes | 35 import ctypes |
| 36 TerminateProcess = ctypes.windll.kernel32.TerminateProcess | 36 TerminateProcess = ctypes.windll.kernel32.TerminateProcess |
| 37 except (ImportError, AttributeError): | 37 except (ImportError, AttributeError): |
| 38 TerminateProcess = None | 38 TerminateProcess = None |
| 39 | |
| 40 | |
| 41 # Do not show error messages due to errors in the program being tested | |
| 42 try: | |
| 43 import ctypes | |
| 44 try: | |
| 45 errmode = ctypes.windll.kernel32.GetErrorMode() | |
| 46 except AttributeError: | |
| 47 errmode = ctypes.windll.kernel32.SetErrorMode(0) | |
| 48 errmode |= 0x8003 | |
| 49 ctypes.windll.kernel32.SetErrorMode(errmode) | |
| 50 except Exception: | |
| 51 pass | |
| 39 | 52 |
| 40 | 53 |
| 41 # Do the hacky-wacky dark magic needed to catch presses of the Escape button. | 54 # Do the hacky-wacky dark magic needed to catch presses of the Escape button. |
| 42 # If only Python supported forcible termination of threads... | 55 # If only Python supported forcible termination of threads... |
| 43 if not sys.stdin.isatty(): | 56 if not sys.stdin.isatty(): |
