mirror of
https://github.com/python/cpython.git
synced 2026-05-09 14:11:28 -04:00
46f821d62b
gh-114763: Protect lazy loading modules from attribute access races (GH-114781)
Setting the __class__ attribute of a lazy-loading module to ModuleType enables other threads to attempt to access attributes before the loading is complete. Now that is protected by a lock.
(cherry picked from commit 200271c61d)
Co-authored-by: Chris Markiewicz <effigies@gmail.com>