Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 647dac9

Browse files
committed
Close #25368: Fix test_eintr when Python is compiled without thread support
1 parent 6da6240 commit 647dac9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Lib/test/eintrdata/eintr_tester.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def setUpClass(cls):
5252
cls.signal_period)
5353

5454
# Issue #25277: Use faulthandler to try to debug a hang on FreeBSD
55-
faulthandler.dump_traceback_later(10 * 60, exit=True)
55+
if hasattr(faulthandler, 'dump_traceback_later'):
56+
faulthandler.dump_traceback_later(10 * 60, exit=True)
5657

5758
@classmethod
5859
def stop_alarm(cls):
@@ -62,7 +63,8 @@ def stop_alarm(cls):
6263
def tearDownClass(cls):
6364
cls.stop_alarm()
6465
signal.signal(signal.SIGALRM, cls.orig_handler)
65-
faulthandler.cancel_dump_traceback_later()
66+
if hasattr(faulthandler, 'cancel_dump_traceback_later'):
67+
faulthandler.cancel_dump_traceback_later()
6668

6769
@classmethod
6870
def _sleep(cls):

0 commit comments

Comments
 (0)