Add import_ensure_initialized to import_module_level#7076
Add import_ensure_initialized to import_module_level#7076youknowone merged 1 commit intoRustPython:mainfrom
Conversation
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.
📝 WalkthroughWalkthroughA new private helper function Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary by CodeRabbit