#17493: merge with 3.3.

This commit is contained in:
Ezio Melotti 2013-03-20 18:16:05 +02:00
commit a612176c9c
1 changed files with 9 additions and 11 deletions

View File

@ -239,9 +239,6 @@ class SysModuleTest(unittest.TestCase):
def test_recursionlimit_fatalerror(self): def test_recursionlimit_fatalerror(self):
# A fatal error occurs if a second recursion limit is hit when recovering # A fatal error occurs if a second recursion limit is hit when recovering
# from a first one. # from a first one.
if os.name == "nt":
raise unittest.SkipTest(
"under Windows, test would generate a spurious crash dialog")
code = textwrap.dedent(""" code = textwrap.dedent("""
import sys import sys
@ -253,13 +250,14 @@ class SysModuleTest(unittest.TestCase):
sys.setrecursionlimit(%d) sys.setrecursionlimit(%d)
f()""") f()""")
with test.support.suppress_crash_popup():
for i in (50, 1000): for i in (50, 1000):
sub = subprocess.Popen([sys.executable, '-c', code % i], sub = subprocess.Popen([sys.executable, '-c', code % i],
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
err = sub.communicate()[1] err = sub.communicate()[1]
self.assertTrue(sub.returncode, sub.returncode) self.assertTrue(sub.returncode, sub.returncode)
self.assertTrue( self.assertIn(
b"Fatal Python error: Cannot recover from stack overflow" in err, b"Fatal Python error: Cannot recover from stack overflow",
err) err)
def test_getwindowsversion(self): def test_getwindowsversion(self):