Skip to content

gh-105922: Use PyImport_AddModuleRef() function - #105999

Merged
vstinner merged 1 commit into
python:mainfrom
vstinner:add_module_ref
Jun 22, 2023
Merged

gh-105922: Use PyImport_AddModuleRef() function#105999
vstinner merged 1 commit into
python:mainfrom
vstinner:add_module_ref

Conversation

@vstinner

@vstinnervstinner commented Jun 22, 2023

Copy link
Copy Markdown
Member

Replace PyImport_AddModuleObject() + Py_XNewRef() with PyImport_AddModuleRef() to get directly a strong reference.

Replace PyImport_AddModuleObject() + Py_XNewRef() with
PyImport_AddModuleRef() to get directly a strong reference.
@vstinner

Copy link
Copy Markdown
MemberAuthor

test_threading failed with a warning on the Address sanitizer CI:

test_4_daemon_threads (test.test_threading.ThreadJoinOnShutdown.test_4_daemon_threads) ... ok
test_clear_threads_states_after_fork (test.test_threading.ThreadJoinOnShutdown.test_clear_threads_states_after_fork) ... ok
test_reinit_tls_after_fork (test.test_threading.ThreadJoinOnShutdown.test_reinit_tls_after_fork) ... Warning -- Uncaught thread exception: AssertionError
Exception in thread Thread-36 (do_fork_and_wait):
Traceback (most recent call last):
File "/home/runner/work/cpython/cpython/Lib/threading.py", line 1052, in _bootstrap_inner
self.run()
File "/home/runner/work/cpython/cpython/Lib/threading.py", line 989, in run
self._target(*self._args, **self._kwargs)
File "/home/runner/work/cpython/cpython/Lib/test/test_threading.py", line 1173, in do_fork_and_wait
support.wait_process(pid, exitcode=50)
File "/home/runner/work/cpython/cpython/Lib/test/support/__init__.py", line 2156, in wait_process
raise AssertionError(f"process {pid} is still running "
AssertionError: process 21364 is still running after 300.3 seconds
ok

@vstinner
vstinner merged commit 193a2b2 into python:mainJun 22, 2023
@vstinner
vstinner deleted the add_module_ref branch June 22, 2023 22:04
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@vstinner@bedevere-bot