mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Revert "bpo-33671: Add support.MS_WINDOWS and support.MACOS (GH-7800)" (GH-7919)
This reverts commit 8fbbdf0c31
.
This commit is contained in:
parent
fdd6e0bf18
commit
937ee9e745
16 changed files with 91 additions and 95 deletions
|
@ -6,7 +6,7 @@ import signal
|
|||
import subprocess
|
||||
import sys
|
||||
from test import support
|
||||
from test.support import script_helper
|
||||
from test.support import script_helper, is_android
|
||||
import tempfile
|
||||
import threading
|
||||
import unittest
|
||||
|
@ -18,6 +18,7 @@ except ImportError:
|
|||
_testcapi = None
|
||||
|
||||
TIMEOUT = 0.5
|
||||
MS_WINDOWS = (os.name == 'nt')
|
||||
|
||||
def expected_traceback(lineno1, lineno2, header, min_count=1):
|
||||
regex = header
|
||||
|
@ -30,7 +31,7 @@ def expected_traceback(lineno1, lineno2, header, min_count=1):
|
|||
|
||||
def skip_segfault_on_android(test):
|
||||
# Issue #32138: Raising SIGSEGV on Android may not cause a crash.
|
||||
return unittest.skipIf(support.ANDROID,
|
||||
return unittest.skipIf(is_android,
|
||||
'raising SIGSEGV on Android is unreliable')(test)
|
||||
|
||||
@contextmanager
|
||||
|
@ -120,7 +121,7 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
@unittest.skipIf(sys.platform.startswith('aix'),
|
||||
"the first page of memory is a mapped read-only on AIX")
|
||||
def test_read_null(self):
|
||||
if not support.MS_WINDOWS:
|
||||
if not MS_WINDOWS:
|
||||
self.check_fatal_error("""
|
||||
import faulthandler
|
||||
faulthandler.enable()
|
||||
|
@ -731,7 +732,7 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
with self.check_stderr_none():
|
||||
faulthandler.register(signal.SIGUSR1)
|
||||
|
||||
@unittest.skipUnless(support.MS_WINDOWS, 'specific to Windows')
|
||||
@unittest.skipUnless(MS_WINDOWS, 'specific to Windows')
|
||||
def test_raise_exception(self):
|
||||
for exc, name in (
|
||||
('EXCEPTION_ACCESS_VIOLATION', 'access violation'),
|
||||
|
@ -746,7 +747,7 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
3,
|
||||
name)
|
||||
|
||||
@unittest.skipUnless(support.MS_WINDOWS, 'specific to Windows')
|
||||
@unittest.skipUnless(MS_WINDOWS, 'specific to Windows')
|
||||
def test_ignore_exception(self):
|
||||
for exc_code in (
|
||||
0xE06D7363, # MSC exception ("Emsc")
|
||||
|
@ -762,7 +763,7 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
self.assertEqual(output, [])
|
||||
self.assertEqual(exitcode, exc_code)
|
||||
|
||||
@unittest.skipUnless(support.MS_WINDOWS, 'specific to Windows')
|
||||
@unittest.skipUnless(MS_WINDOWS, 'specific to Windows')
|
||||
def test_raise_nonfatal_exception(self):
|
||||
# These exceptions are not strictly errors. Letting
|
||||
# faulthandler display the traceback when they are
|
||||
|
@ -790,7 +791,7 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
self.assertIn(exitcode,
|
||||
(exc, exc & ~0x10000000))
|
||||
|
||||
@unittest.skipUnless(support.MS_WINDOWS, 'specific to Windows')
|
||||
@unittest.skipUnless(MS_WINDOWS, 'specific to Windows')
|
||||
def test_disable_windows_exc_handler(self):
|
||||
code = dedent("""
|
||||
import faulthandler
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue