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
e5f4d3c2
Commit
e5f4d3c2
authored
Feb 20, 2016
by
Brett Cannon
Browse files
Options
Browse Files
Download
Plain Diff
Merge for issue #26186
parents
0911c0d2
558823a0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
6 deletions
+4
-6
Lib/importlib/abc.py
Lib/importlib/abc.py
+0
-1
Lib/importlib/util.py
Lib/importlib/util.py
+0
-5
Lib/test/test_importlib/test_lazy.py
Lib/test/test_importlib/test_lazy.py
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/importlib/abc.py
View file @
e5f4d3c2
...
...
@@ -4,7 +4,6 @@ from . import _bootstrap_external
from
.
import
machinery
try
:
import
_frozen_importlib
# import _frozen_importlib_external
except
ImportError
as
exc
:
if
exc
.
name
!=
'_frozen_importlib'
:
raise
...
...
Lib/importlib/util.py
View file @
e5f4d3c2
...
...
@@ -263,11 +263,6 @@ class LazyLoader(abc.Loader):
def
__check_eager_loader
(
loader
):
if
not
hasattr
(
loader
,
'exec_module'
):
raise
TypeError
(
'loader must define exec_module()'
)
elif
hasattr
(
loader
.
__class__
,
'create_module'
):
if
abc
.
Loader
.
create_module
!=
loader
.
__class__
.
create_module
:
# Only care if create_module() is overridden in a subclass of
# importlib.abc.Loader.
raise
TypeError
(
'loader cannot define create_module()'
)
@
classmethod
def
factory
(
cls
,
loader
):
...
...
Lib/test/test_importlib/test_lazy.py
View file @
e5f4d3c2
...
...
@@ -54,6 +54,7 @@ class LazyLoaderTests(unittest.TestCase):
def
test_init
(
self
):
with
self
.
assertRaises
(
TypeError
):
# Classes that dono't define exec_module() trigger TypeError.
util
.
LazyLoader
(
object
)
def
new_module
(
self
,
source_code
=
None
):
...
...
Misc/NEWS
View file @
e5f4d3c2
...
...
@@ -185,6 +185,9 @@ Core and Builtins
Library
-------
Issue
#
26186
:
Remove
an
invalid
type
check
in
importlib
.
util
.
LazyLoader
.
-
Issue
#
26367
:
importlib
.
__init__
()
raises
ImportError
like
builtins
.
__import__
()
when
``
level
``
is
specified
but
without
an
accompanying
package
specified
.
...
...
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