8000 gh-128400: Only show the current thread in `Py_FatalError` on the free-threaded build by ZeroIntensity · Pull Request #128758 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128400: Only show the current thread in Py_FatalError on the free-threaded build #128758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix C API tests.
  • Loading branch information
ZeroIntensity committed Jan 13, 2025
commit af6a910321a557db346bf6aed7a8a98885d04555
14 changes: 8 additions & 6 deletions Lib/test/test_capi/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ class InstanceMethod:
id = _testcapi.instancemethod(id)
testfunction = _testcapi.instancemethod(testfunction)

CURRENT_THREAD_REGEX = r'Current thread.*:\n' if not support.Py_GIL_DISABLED else r'Stack .*:\n'

class CAPITest(unittest.TestCase):

def test_instancemethod(self):
Expand Down Expand Up @@ -234,8 +236,8 @@ def test_return_null_without_error(self):
r'Python runtime state: initialized\n'
r'SystemError: <built-in function return_null_without_error> '
r'returned NULL without setting an exception\n'
r'\n'
r'Current thread.*:\n'
r'\n' +
CURRENT_THREAD_REGEX +
r' File .*", line 6 in <module>\n')
else:
with self.assertRaises(SystemError) as cm:
Expand Down Expand Up @@ -268,8 +270,8 @@ def test_return_result_with_error(self):
r'SystemError: <built-in '
r'function return_result_with_error> '
r'returned a result with an exception set\n'
r'\n'
r'Current thread.*:\n'
r'\n' +
CURRENT_THREAD_REGEX +
r' File .*, line 6 in <module>\n')
else:
with self.assertRaises(SystemError) as cm:
Expand Down Expand Up @@ -298,8 +300,8 @@ def test_getitem_with_error(self):
r'with an exception set\n'
r'Python runtime state: initialized\n'
r'ValueError: bug\n'
r'\n'
r'Current thread .* \(most recent call first\):\n'
r'\n' +
CURRENT_THREAD_REGEX +
r' File .*, line 6 in <module>\n'
r'\n'
r'Extension modules: _testcapi \(total: 1\)\n')
Expand Down
Loading
0