Skip to content
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

gh-105922: Use PyImport_AddModuleRef() function #105999

Merged
merged 1 commit into from
Jun 22, 2023

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 22, 2023

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
Member Author

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:main Jun 22, 2023
@vstinner vstinner deleted the add_module_ref branch June 22, 2023 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants