From 8d18907a2e4b821774459d6eeeb180eed1184ec1 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sun, 22 Aug 2010 20:38:47 +0000 Subject: While not strictly necessary thanks to the odd ABC inheritance done through importlib._bootstrap, add the optional methods for importlib.abc.SourceLoader for completeness. --- Lib/importlib/abc.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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): -- cgit v0.12