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
806fb3f6
Commit
806fb3f6
authored
Feb 21, 2009
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Relocate source_mtime in importlib to PyPycLoader.
parent
e6e95376
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
Lib/importlib/_bootstrap.py
Lib/importlib/_bootstrap.py
+11
-13
No files found.
Lib/importlib/_bootstrap.py
View file @
806fb3f6
...
...
@@ -320,7 +320,7 @@ class PyLoader:
"""Loader base class for Python source.
Requires implementing the optional PEP 302 protocols as well as
source_
mtime and source_
path.
source_path.
"""
...
...
@@ -371,7 +371,7 @@ class PyPycLoader(PyLoader):
"""Loader base class for Python source and bytecode.
Requires implementing the methods needed for PyLoader as well as
bytecode_path
and write_bytecode.
source_mtime, bytecode_path,
and write_bytecode.
"""
...
...
@@ -461,16 +461,6 @@ class PyFileLoader(PyLoader):
# Not a property so that it is easy to override.
return
self
.
_find_path
(
imp
.
PY_SOURCE
)
@
check_name
def
source_mtime
(
self
,
name
):
"""Return the modification time of the source for the specified
module."""
source_path
=
self
.
source_path
(
name
)
if
not
source_path
:
return
None
return
int
(
_os
.
stat
(
source_path
).
st_mtime
)
@
check_name
def
get_source
(
self
,
fullname
):
"""Return the source for the module as a string.
...
...
@@ -505,11 +495,19 @@ class PyFileLoader(PyLoader):
return
self
.
_is_pkg
# XXX Rename _PyFileLoader throughout
class
PyPycFileLoader
(
PyPycLoader
,
PyFileLoader
):
"""Load a module from a source or bytecode file."""
@
check_name
def
source_mtime
(
self
,
name
):
"""Return the modification time of the source for the specified
module."""
source_path
=
self
.
source_path
(
name
)
if
not
source_path
:
return
None
return
int
(
_os
.
stat
(
source_path
).
st_mtime
)
@
check_name
def
bytecode_path
(
self
,
fullname
):
"""Return the path to a bytecode file, or None if one does not
...
...
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