summaryrefslogtreecommitdiff
path: root/tests/thread/thread_exit2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/thread/thread_exit2.py')
-rw-r--r--tests/thread/thread_exit2.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/thread/thread_exit2.py b/tests/thread/thread_exit2.py
index 0cd80e690..5be7945db 100644
--- a/tests/thread/thread_exit2.py
+++ b/tests/thread/thread_exit2.py
@@ -13,8 +13,13 @@ def thread_entry():
raise SystemExit
-_thread.start_new_thread(thread_entry, ())
-_thread.start_new_thread(thread_entry, ())
+for i in range(2):
+ while True:
+ try:
+ _thread.start_new_thread(thread_entry, ())
+ break
+ except OSError:
+ pass
# wait for threads to finish
time.sleep(1)