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
2f92389d
Commit
2f92389d
authored
Apr 21, 2012
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't worry about moving imp.get_tag() over to Lib/imp.py.
parent
b582c923
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3070 additions
and
3065 deletions
+3070
-3065
Lib/imp.py
Lib/imp.py
+2
-2
Lib/importlib/_bootstrap.py
Lib/importlib/_bootstrap.py
+3
-1
Python/importlib.h
Python/importlib.h
+3065
-3062
No files found.
Lib/imp.py
View file @
2f92389d
...
@@ -11,9 +11,9 @@ from _imp import (lock_held, acquire_lock, release_lock, reload,
...
@@ -11,9 +11,9 @@ from _imp import (lock_held, acquire_lock, release_lock, reload,
init_builtin
,
init_frozen
,
is_builtin
,
is_frozen
,
init_builtin
,
init_frozen
,
is_builtin
,
is_frozen
,
_fix_co_filename
)
_fix_co_filename
)
# Could move out of _imp, but not worth the code
# Could move out of _imp, but not worth the code
from
_imp
import
get_magic
from
_imp
import
get_magic
,
get_tag
# Can (probably) move to importlib
# Can (probably) move to importlib
from
_imp
import
(
get_tag
,
get_suffixes
)
from
_imp
import
get_suffixes
# Should be re-implemented here (and mostly deprecated)
# Should be re-implemented here (and mostly deprecated)
from
_imp
import
(
find_module
,
NullImporter
,
from
_imp
import
(
find_module
,
NullImporter
,
SEARCH_ERROR
,
PY_SOURCE
,
PY_COMPILED
,
C_EXTENSION
,
SEARCH_ERROR
,
PY_SOURCE
,
PY_COMPILED
,
C_EXTENSION
,
...
...
Lib/importlib/_bootstrap.py
View file @
2f92389d
...
@@ -201,7 +201,7 @@ def _cache_from_source(path, debug_override=None):
...
@@ -201,7 +201,7 @@ def _cache_from_source(path, debug_override=None):
suffix
=
DEBUG_BYTECODE_SUFFIX
if
debug
else
OPT_BYTECODE_SUFFIX
suffix
=
DEBUG_BYTECODE_SUFFIX
if
debug
else
OPT_BYTECODE_SUFFIX
head
,
tail
=
_path_split
(
path
)
head
,
tail
=
_path_split
(
path
)
base_filename
,
sep
,
_
=
tail
.
partition
(
'.'
)
base_filename
,
sep
,
_
=
tail
.
partition
(
'.'
)
filename
=
''
.
join
([
base_filename
,
sep
,
_
imp
.
get_tag
()
,
suffix
])
filename
=
''
.
join
([
base_filename
,
sep
,
_
TAG
,
suffix
])
return
_path_join
(
head
,
PYCACHE
,
filename
)
return
_path_join
(
head
,
PYCACHE
,
filename
)
...
@@ -1148,6 +1148,7 @@ def __import__(name, globals={}, locals={}, fromlist=[], level=0):
...
@@ -1148,6 +1148,7 @@ def __import__(name, globals={}, locals={}, fromlist=[], level=0):
_MAGIC_NUMBER
=
None
# Set in _setup()
_MAGIC_NUMBER
=
None
# Set in _setup()
_TAG
=
None
# Set in _setup()
def
_setup
(
sys_module
,
_imp_module
):
def
_setup
(
sys_module
,
_imp_module
):
...
@@ -1197,6 +1198,7 @@ def _setup(sys_module, _imp_module):
...
@@ -1197,6 +1198,7 @@ def _setup(sys_module, _imp_module):
# Constants
# Constants
setattr
(
self_module
,
'_relax_case'
,
_make_relax_case
())
setattr
(
self_module
,
'_relax_case'
,
_make_relax_case
())
setattr
(
self_module
,
'_MAGIC_NUMBER'
,
_imp_module
.
get_magic
())
setattr
(
self_module
,
'_MAGIC_NUMBER'
,
_imp_module
.
get_magic
())
setattr
(
self_module
,
'_TAG'
,
_imp
.
get_tag
())
if
builtin_os
==
'nt'
:
if
builtin_os
==
'nt'
:
SOURCE_SUFFIXES
.
append
(
'.pyw'
)
SOURCE_SUFFIXES
.
append
(
'.pyw'
)
...
...
Python/importlib.h
View file @
2f92389d
This diff is collapsed.
Click to expand it.
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