Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
920df332
Commit
920df332
authored
Mar 21, 2014
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20884: Don't assume in importlib.__init__ that __file__ is
defined.
parent
7791cb27
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
Lib/importlib/__init__.py
Lib/importlib/__init__.py
+6
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/importlib/__init__.py
View file @
920df332
...
...
@@ -22,7 +22,12 @@ else:
# a second copy of the module.
_bootstrap
.
__name__
=
'importlib._bootstrap'
_bootstrap
.
__package__
=
'importlib'
_bootstrap
.
__file__
=
__file__
.
replace
(
'__init__.py'
,
'_bootstrap.py'
)
try
:
_bootstrap
.
__file__
=
__file__
.
replace
(
'__init__.py'
,
'_bootstrap.py'
)
except
NameError
:
# __file__ is not guaranteed to be defined, e.g. if this code gets
# frozen by a tool like cx_Freeze.
pass
sys
.
modules
[
'importlib._bootstrap'
]
=
_bootstrap
# To simplify imports in test code
...
...
Misc/NEWS
View file @
920df332
...
...
@@ -21,6 +21,8 @@ Core and Builtins
Library
-------
- Issue #20884: Don'
t
assume
that
__file__
is
defined
on
importlib
.
__init__
.
-
Issue
#
20879
:
Delay
the
initialization
of
encoding
and
decoding
tables
for
base32
,
ascii85
and
base85
codecs
in
the
base64
module
,
and
delay
the
initialization
of
the
unquote_to_bytes
()
table
of
the
urllib
.
parse
module
,
to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment