summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/abc.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-08-22 20:38:47 (GMT)
committerBrett Cannon <bcannon@gmail.com>2010-08-22 20:38:47 (GMT)
commit8d18907a2e4b821774459d6eeeb180eed1184ec1 (patch)
tree80cad486c1d3e168654669ef3dd1a76a1910df1d /Lib/importlib/abc.py
parent2525dc8fb6ce87502b09bbf9965065ab296d9b07 (diff)
downloadcpython-8d18907a2e4b821774459d6eeeb180eed1184ec1.zip
cpython-8d18907a2e4b821774459d6eeeb180eed1184ec1.tar.gz
cpython-8d18907a2e4b821774459d6eeeb180eed1184ec1.tar.bz2
While not strictly necessary thanks to the odd ABC inheritance done through
importlib._bootstrap, add the optional methods for importlib.abc.SourceLoader for completeness.
Diffstat (limited to 'Lib/importlib/abc.py')
-rw-r--r--Lib/importlib/abc.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py
index 6a7e364..3c6b481 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -117,6 +117,20 @@ class SourceLoader(_bootstrap.SourceLoader, ResourceLoader, ExecutionLoader):
"""
+ def path_mtime(self, path:str) -> int:
+ """Return the modification time for the path."""
+ raise NotImplementedError
+
+ def set_data(self, path:str, data:bytes) -> None:
+ """Write the bytes to the path (if possible).
+
+ Any needed intermediary directories are to be created. If for some
+ reason the file cannot be written because of permissions, fail
+ silently.
+
+ """
+ raise NotImplementedError
+
class PyLoader(SourceLoader):