◐ Shell
clean mode source ↗

Add import_ensure_initialized to import_module_level by youknowone · Pull Request #7076 · RustPython/RustPython

Wait for module initialization to complete when a module is
already in sys.modules but still being initialized by another
thread. Check __spec__._initializing and call
_lock_unlock_module to block until the import finishes.

@youknowone marked this pull request as ready for review

February 11, 2026 00:33

youknowone added a commit to youknowone/RustPython that referenced this pull request

Mar 22, 2026
Wait for module initialization to complete when a module is
already in sys.modules but still being initialized by another
thread. Check __spec__._initializing and call
_lock_unlock_module to block until the import finishes.