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
a6cfb28b
Commit
a6cfb28b
authored
Dec 04, 2012
by
Eric Snow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #15627: This is simply an update to the name of a new method recently added
to importlib.abc.SourceLoader.
parent
fe907e18
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
14 deletions
+14
-14
Doc/library/importlib.rst
Doc/library/importlib.rst
+1
-1
Lib/importlib/_bootstrap.py
Lib/importlib/_bootstrap.py
+2
-2
Lib/test/test_importlib/source/test_abc_loader.py
Lib/test/test_importlib/source/test_abc_loader.py
+2
-2
Misc/NEWS
Misc/NEWS
+1
-1
Python/importlib.h
Python/importlib.h
+8
-8
No files found.
Doc/library/importlib.rst
View file @
a6cfb28b
...
...
@@ -409,7 +409,7 @@ ABC hierarchy::
When writing to the path fails because the path is read-only
(:attr:`errno.EACCES`), do not propagate the exception.
.. method::
compile_sourc
e(data, path)
.. method::
source_to_cod
e(data, path)
Create a code object from Python source.
...
...
Lib/importlib/_bootstrap.py
View file @
a6cfb28b
...
...
@@ -931,7 +931,7 @@ class SourceLoader(_LoaderBasics):
raise
ImportError
(
"Failed to decode source file"
,
name
=
fullname
)
from
exc
def
compile_sourc
e
(
self
,
data
,
path
):
def
source_to_cod
e
(
self
,
data
,
path
):
"""Return the code object compiled from source.
The 'data' argument can be any object type that compile() supports.
...
...
@@ -984,7 +984,7 @@ class SourceLoader(_LoaderBasics):
raise
ImportError
(
msg
.
format
(
bytecode_path
),
name
=
fullname
,
path
=
bytecode_path
)
source_bytes
=
self
.
get_data
(
source_path
)
code_object
=
self
.
compile_sourc
e
(
source_bytes
,
source_path
)
code_object
=
self
.
source_to_cod
e
(
source_bytes
,
source_path
)
_verbose_message
(
'code object from {}'
,
source_path
)
if
(
not
sys
.
dont_write_bytecode
and
bytecode_path
is
not
None
and
source_mtime
is
not
None
):
...
...
Lib/test/test_importlib/source/test_abc_loader.py
View file @
a6cfb28b
...
...
@@ -148,9 +148,9 @@ class SourceOnlyLoaderTests(SourceLoaderTestHarness):
code_object
=
self
.
loader
.
get_code
(
self
.
name
)
self
.
verify_code
(
code_object
)
def
test_
compile_sourc
e
(
self
):
def
test_
source_to_cod
e
(
self
):
# Verify the compiled code object.
code
=
self
.
loader
.
compile_sourc
e
(
self
.
loader
.
source
,
self
.
path
)
code
=
self
.
loader
.
source_to_cod
e
(
self
.
loader
.
source
,
self
.
path
)
self
.
verify_code
(
code
)
def
test_load_module
(
self
):
...
...
Misc/NEWS
View file @
a6cfb28b
...
...
@@ -190,7 +190,7 @@ Library
-
Issue
#
16522
:
added
FAIL_FAST
flag
to
doctest
.
-
Issue
#
15627
:
Add
the
importlib
.
abc
.
SourceLoader
.
compile_sourc
e
()
method
.
-
Issue
#
15627
:
Add
the
importlib
.
abc
.
SourceLoader
.
source_to_cod
e
()
method
.
-
Issue
#
16408
:
Fix
file
descriptors
not
being
closed
in
error
conditions
in
the
zipfile
module
.
Patch
by
Serhiy
Storchaka
.
...
...
Python/importlib.h
View file @
a6cfb28b
...
...
@@ -2200,11 +2200,11 @@ unsigned char _Py_M__importlib[] = {
97
,
116
,
97
,
117
,
4
,
0
,
0
,
0
,
112
,
97
,
116
,
104
,
40
,
0
,
0
,
0
,
0
,
40
,
0
,
0
,
0
,
0
,
117
,
29
,
0
,
0
,
0
,
60
,
102
,
114
,
111
,
122
,
101
,
110
,
32
,
105
,
109
,
112
,
111
,
114
,
116
,
108
,
105
,
98
,
46
,
95
,
98
,
111
,
111
,
116
,
115
,
116
,
114
,
97
,
112
,
62
,
117
,
14
,
0
,
0
,
0
,
99
,
111
,
109
,
11
2
,
105
,
108
,
101
,
95
,
115
,
111
,
117
,
114
,
99
,
101
,
166
,
3
,
0
,
0
,
115
,
111
,
116
,
115
,
116
,
114
,
97
,
112
,
62
,
117
,
14
,
0
,
0
,
0
,
115
,
111
,
117
,
11
4
,
99
,
101
,
95
,
116
,
111
,
95
,
99
,
111
,
100
,
101
,
166
,
3
,
0
,
0
,
115
,
4
,
0
,
0
,
0
,
0
,
5
,
18
,
1
,
117
,
27
,
0
,
0
,
0
,
83
,
111
,
117
,
114
,
99
,
101
,
76
,
111
,
97
,
100
,
101
,
114
,
46
,
99
,
111
,
109
,
112
,
105
,
108
,
101
,
95
,
115
,
111
,
117
,
114
,
99
,
101
,
99
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
114
,
99
,
101
,
76
,
111
,
97
,
100
,
101
,
114
,
46
,
115
,
111
,
117
,
114
,
99
,
101
,
95
,
116
,
111
,
95
,
99
,
111
,
100
,
101
,
99
,
2
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
12
,
0
,
0
,
0
,
45
,
0
,
0
,
0
,
67
,
0
,
0
,
0
,
115
,
43
,
2
,
0
,
0
,
124
,
0
,
0
,
106
,
0
,
0
,
124
,
1
,
0
,
131
,
1
,
0
,
125
,
2
,
0
,
100
,
8
,
0
,
125
,
3
,
0
,
121
,
16
,
0
,
116
,
2
,
0
,
124
,
2
,
0
,
...
...
@@ -2278,8 +2278,8 @@ unsigned char _Py_M__importlib[] = {
99
,
101
,
117
,
10
,
0
,
0
,
0
,
95
,
99
,
111
,
100
,
101
,
95
,
116
,
121
,
112
,
101
,
117
,
4
,
0
,
0
,
0
,
95
,
105
,
109
,
112
,
117
,
16
,
0
,
0
,
0
,
95
,
102
,
105
,
120
,
95
,
99
,
111
,
95
,
102
,
105
,
108
,
101
,
110
,
97
,
109
,
101
,
117
,
6
,
0
,
0
,
0
,
102
,
111
,
114
,
109
,
97
,
116
,
117
,
14
,
0
,
0
,
0
,
99
,
111
,
1
09
,
112
,
105
,
108
,
101
,
95
,
115
,
111
,
117
,
114
,
99
,
101
,
117
,
3
,
0
,
6
,
0
,
0
,
0
,
102
,
111
,
114
,
109
,
97
,
116
,
117
,
14
,
0
,
0
,
0
,
115
,
111
,
1
17
,
114
,
99
,
101
,
95
,
116
,
111
,
95
,
99
,
111
,
100
,
101
,
117
,
3
,
0
,
0
,
0
,
115
,
121
,
115
,
117
,
19
,
0
,
0
,
0
,
100
,
111
,
110
,
116
,
95
,
119
,
114
,
105
,
116
,
101
,
95
,
98
,
121
,
116
,
101
,
99
,
111
,
100
,
101
,
117
,
9
,
0
,
0
,
0
,
98
,
121
,
116
,
101
,
97
,
114
,
114
,
97
,
121
,
117
,
12
,
0
,
0
,
0
,
...
...
@@ -2345,8 +2345,8 @@ unsigned char _Py_M__importlib[] = {
112
,
97
,
116
,
104
,
95
,
115
,
116
,
97
,
116
,
115
,
117
,
15
,
0
,
0
,
0
,
95
,
99
,
97
,
99
,
104
,
101
,
95
,
98
,
121
,
116
,
101
,
99
,
111
,
100
,
101
,
117
,
8
,
0
,
0
,
0
,
115
,
101
,
116
,
95
,
100
,
97
,
116
,
97
,
117
,
10
,
0
,
0
,
0
,
103
,
101
,
116
,
95
,
115
,
111
,
117
,
114
,
99
,
101
,
117
,
14
,
0
,
0
,
0
,
99
,
111
,
1
09
,
112
,
105
,
108
,
101
,
95
,
115
,
111
,
117
,
114
,
99
,
101
,
117
,
8
,
0
,
103
,
101
,
116
,
95
,
115
,
111
,
117
,
114
,
99
,
101
,
117
,
14
,
0
,
0
,
0
,
115
,
111
,
1
17
,
114
,
99
,
101
,
95
,
116
,
111
,
95
,
99
,
111
,
100
,
101
,
117
,
8
,
0
,
0
,
0
,
103
,
101
,
116
,
95
,
99
,
111
,
100
,
101
,
117
,
11
,
0
,
0
,
0
,
108
,
111
,
97
,
100
,
95
,
109
,
111
,
100
,
117
,
108
,
101
,
40
,
1
,
0
,
0
,
0
,
117
,
10
,
0
,
0
,
0
,
95
,
95
,
108
,
111
,
99
,
97
,
108
,
115
,
95
,
95
,
40
,
0
,
...
...
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