If multiple threads concurrently imported `collections.abc`, some of the
threads might incorrectly see the "shim" `Lib/collections/abc.py` module
instead of the correct `Lib/_collections_abc.py` module. This affected
both the free threading build and the default GIL-enabled build.
import _collections_abc
import sys as _sys
+_sys.modules['collections.abc'] = _collections_abc
+abc = _collections_abc
+
from itertools import chain as _chain
from itertools import repeat as _repeat
from itertools import starmap as _starmap
+++ /dev/null
-import _collections_abc
-import sys
-sys.modules[__name__] = _collections_abc
--- /dev/null
+Fix race condition when importing :mod:`collections.abc`, which could
+incorrectly return an empty module.