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
3821e2d2
Commit
3821e2d2
authored
Feb 16, 2007
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the __import__ call in encodings.__init__ absolute with a level 0 call.
parent
22d079b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/encodings/__init__.py
Lib/encodings/__init__.py
+4
-4
No files found.
Lib/encodings/__init__.py
View file @
3821e2d2
...
...
@@ -93,10 +93,10 @@ def search_function(encoding):
if
not
modname
or
'.'
in
modname
:
continue
try
:
# Import
equivalent to `` from .modname import *``.
#
'*' is used so that __import__ returns the desired module and not
# 'encodings' itself.
mod
=
__import__
(
modname
,
globals
(),
locals
(),
[
'*'
],
1
)
# Import
is absolute to prevent the possibly malicious import of a
#
module with side-effects that is not in the 'encodings' package.
mod
=
__import__
(
'encodings.'
+
modname
,
fromlist
=
_import_tail
,
level
=
0
)
except
ImportError
:
pass
else
:
...
...
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