File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 # a second copy of the module.
2323 _bootstrap .__name__ = 'importlib._bootstrap'
2424 _bootstrap .__package__ = 'importlib'
25- _bootstrap .__file__ = __file__ .replace ('__init__.py' , '_bootstrap.py' )
25+ try :
26+ _bootstrap .__file__ = __file__ .replace ('__init__.py' , '_bootstrap.py' )
27+ except NameError :
28+ # __file__ is not guaranteed to be defined, e.g. if this code gets
29+ # frozen by a tool like cx_Freeze.
30+ pass
2631 sys .modules ['importlib._bootstrap' ] = _bootstrap
2732
2833# To simplify imports in test code
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ Core and Builtins
2121Library
2222-------
2323
24+ - Issue #20884: Don't assume that __file__ is defined on importlib.__init__.
25+
2426- Issue #20879: Delay the initialization of encoding and decoding tables for
2527 base32, ascii85 and base85 codecs in the base64 module, and delay the
2628 initialization of the unquote_to_bytes() table of the urllib.parse module, to
You can’t perform that action at this time.
0 commit comments