mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
gh-128400: Only show the current thread in Py_FatalError on the free-threaded build (#128758)
This commit is contained in:
parent
4533036e50
commit
bf64a582f0
4 changed files with 22 additions and 12 deletions
|
|
@ -101,8 +101,7 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
Raise an error if the output doesn't match the expected format.
|
||||
"""
|
||||
all_threads_disabled = (
|
||||
(not py_fatal_error)
|
||||
and all_threads
|
||||
all_threads
|
||||
and (not sys._is_gil_enabled())
|
||||
)
|
||||
if all_threads and not all_threads_disabled:
|
||||
|
|
@ -116,12 +115,15 @@ class FaultHandlerTests(unittest.TestCase):
|
|||
if py_fatal_error:
|
||||
regex.append("Python runtime state: initialized")
|
||||
regex.append('')
|
||||
if all_threads_disabled:
|
||||
if all_threads_disabled and not py_fatal_error:
|
||||
regex.append("<Cannot show all threads while the GIL is disabled>")
|
||||
regex.append(fr'{header} \(most recent call first\):')
|
||||
if garbage_collecting and not all_threads_disabled:
|
||||
regex.append(' Garbage-collecting')
|
||||
regex.append(fr' File "<string>", line {lineno} in {function}')
|
||||
if support.Py_GIL_DISABLED and py_fatal_error and not know_current_thread:
|
||||
regex.append(" <tstate is freed>")
|
||||
else:
|
||||
if garbage_collecting and not all_threads_disabled:
|
||||
regex.append(' Garbage-collecting')
|
||||
regex.append(fr' File "<string>", line {lineno} in {function}')
|
||||
regex = '\n'.join(regex)
|
||||
|
||||
if other_regex:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue