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
e1d30f24
Commit
e1d30f24
authored
Apr 28, 2013
by
Brett Cannon
Browse files
Options
Browse Files
Download
Plain Diff
merge for issue #17358
parents
d4c1b36c
5a4c233a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
Lib/imp.py
Lib/imp.py
+12
-2
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/imp.py
View file @
e1d30f24
...
...
@@ -111,7 +111,12 @@ def load_source(name, pathname, file=None):
'importlib.machinery.SourceFileLoader(name, pathname).load_module()'
' instead'
)
warnings
.
warn
(
msg
,
DeprecationWarning
,
2
)
return
_LoadSourceCompatibility
(
name
,
pathname
,
file
).
load_module
(
name
)
_LoadSourceCompatibility
(
name
,
pathname
,
file
).
load_module
(
name
)
module
=
sys
.
modules
[
name
]
# To allow reloading to potentially work, use a non-hacked loader which
# won't rely on a now-closed file object.
module
.
__loader__
=
_bootstrap
.
SourceFileLoader
(
name
,
pathname
)
return
module
class
_LoadCompiledCompatibility
(
_HackedGetData
,
...
...
@@ -125,7 +130,12 @@ def load_compiled(name, pathname, file=None):
'importlib.machinery.SourcelessFileLoader(name, pathname).'
'load_module() instead '
)
warnings
.
warn
(
msg
,
DeprecationWarning
,
2
)
return
_LoadCompiledCompatibility
(
name
,
pathname
,
file
).
load_module
(
name
)
_LoadCompiledCompatibility
(
name
,
pathname
,
file
).
load_module
(
name
)
module
=
sys
.
modules
[
name
]
# To allow reloading to potentially work, use a non-hacked loader which
# won't rely on a now-closed file object.
module
.
__loader__
=
_bootstrap
.
SourcelessFileLoader
(
name
,
pathname
)
return
module
def
load_package
(
name
,
path
):
...
...
Misc/NEWS
View file @
e1d30f24
...
...
@@ -52,6 +52,9 @@ Core and Builtins
Library
-------
- Issue #17358: Modules loaded by imp.load_source() and load_compiled() (and by
extention load_module()) now have a better chance of working when reloaded.
- Issue #17804: New function ``struct.iter_unpack`` allows for streaming
struct unpacking.
...
...
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