diff -r 3894e17e59c4 Lib/test/test_capi.py --- a/Lib/test/test_capi.py Sat Sep 14 00:40:46 2013 +0200 +++ b/Lib/test/test_capi.py Fri Sep 13 18:27:40 2013 -0700 @@ -44,12 +44,13 @@ @unittest.skipUnless(threading, 'Threading required for this test.') def test_no_FatalError_infinite_loop(self): - with support.suppress_crash_popup(): - p = subprocess.Popen([sys.executable, "-c", - 'import _testcapi;' - '_testcapi.crash_no_current_thread()'], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + with support.SuppressCoreFiles(): + with support.suppress_crash_popup(): + p = subprocess.Popen([sys.executable, "-c", + 'import _testcapi;' + '_testcapi.crash_no_current_thread()'], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) (out, err) = p.communicate() self.assertEqual(out, b'') # This used to cause an infinite loop. diff -r 3894e17e59c4 Lib/test/test_faulthandler.py --- a/Lib/test/test_faulthandler.py Sat Sep 14 00:40:46 2013 +0200 +++ b/Lib/test/test_faulthandler.py Fri Sep 13 18:27:40 2013 -0700 @@ -19,18 +19,6 @@ TIMEOUT = 0.5 -try: - from resource import setrlimit, RLIMIT_CORE, error as resource_error -except ImportError: - prepare_subprocess = None -else: - def prepare_subprocess(): - # don't create core file - try: - setrlimit(RLIMIT_CORE, (0, 0)) - except (ValueError, resource_error): - pass - def expected_traceback(lineno1, lineno2, header, min_count=1): regex = header regex += ' File "", line %s in func\n' % lineno1 @@ -59,10 +47,8 @@ build, and replace "Current thread 0x00007f8d8fbd9700" by "Current thread XXX". """ - options = {} - if prepare_subprocess: - options['preexec_fn'] = prepare_subprocess - process = script_helper.spawn_python('-c', code, **options) + with support.SuppressCoreFiles(): + process = script_helper.spawn_python('-c', code) stdout, stderr = process.communicate() exitcode = process.wait() output = support.strip_python_stderr(stdout) diff -r 3894e17e59c4 Lib/test/test_sys.py --- a/Lib/test/test_sys.py Sat Sep 14 00:40:46 2013 +0200 +++ b/Lib/test/test_sys.py Fri Sep 13 18:27:40 2013 -0700 @@ -250,15 +250,16 @@ sys.setrecursionlimit(%d) f()""") - with test.support.suppress_crash_popup(): - for i in (50, 1000): - sub = subprocess.Popen([sys.executable, '-c', code % i], - stderr=subprocess.PIPE) - err = sub.communicate()[1] - self.assertTrue(sub.returncode, sub.returncode) - self.assertIn( - b"Fatal Python error: Cannot recover from stack overflow", - err) + with test.support.SuppressCoreFiles(): + with test.support.suppress_crash_popup(): + for i in (50, 1000): + sub = subprocess.Popen([sys.executable, '-c', code % i], + stderr=subprocess.PIPE) + err = sub.communicate()[1] + self.assertTrue(sub.returncode, sub.returncode) + self.assertIn( + b"Fatal Python error: Cannot recover from stack overflow", + err) def test_getwindowsversion(self): # Raise SkipTest if sys doesn't have getwindowsversion attribute diff -r 3894e17e59c4 Lib/test/test_threading.py --- a/Lib/test/test_threading.py Sat Sep 14 00:40:46 2013 +0200 +++ b/Lib/test/test_threading.py Fri Sep 13 18:27:40 2013 -0700 @@ -839,7 +839,8 @@ _testcapi.run_in_subinterp(%r) """ % (subinterp_code,) - rc, out, err = assert_python_failure("-c", script) + with test.support.SuppressCoreFiles(): + rc, out, err = assert_python_failure("-c", script) self.assertIn("Fatal Python error: Py_EndInterpreter: " "not the last thread", err.decode())