mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
Issue9670: Back out changeset b0d2b696da19; test fails on other platforms
and on OS X with pydebug.
This commit is contained in:
parent
e427f0f432
commit
04cb72f968
3 changed files with 0 additions and 47 deletions
|
@ -666,36 +666,6 @@ class ThreadingExceptionTests(BaseTestCase):
|
|||
thread.start()
|
||||
self.assertRaises(RuntimeError, setattr, thread, "daemon", True)
|
||||
|
||||
def test_recursion_limit(self):
|
||||
# Issue 9670
|
||||
# test that excessive recursion within a non-main thread causes
|
||||
# an exception rather than crashing the interpreter on platforms
|
||||
# like Mac OS X or FreeBSD which have small default stack sizes
|
||||
# for threads
|
||||
script = """if True:
|
||||
import threading
|
||||
|
||||
def recurse():
|
||||
return recurse()
|
||||
|
||||
def outer():
|
||||
try:
|
||||
recurse()
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
w = threading.Thread(target=outer)
|
||||
w.start()
|
||||
w.join()
|
||||
print('end of main thread')
|
||||
"""
|
||||
expected_output = "end of main thread\n"
|
||||
p = subprocess.Popen([sys.executable, "-c", script],
|
||||
stdout=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
data = stdout.decode().replace('\r', '')
|
||||
self.assertEqual(p.returncode, 0, "Unexpected error")
|
||||
self.assertEqual(data, expected_output)
|
||||
|
||||
class LockTests(lock_tests.LockTests):
|
||||
locktype = staticmethod(threading.Lock)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue