From: Brett Cannon Date: Sun, 22 Aug 2010 20:38:47 +0000 (+0000) Subject: While not strictly necessary thanks to the odd ABC inheritance done through X-Git-Tag: v3.2a2~165 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8d18907a2e4b821774459d6eeeb180eed1184ec1;p=thirdparty%2FPython%2Fcpython.git While not strictly necessary thanks to the odd ABC inheritance done through importlib._bootstrap, add the optional methods for importlib.abc.SourceLoader for completeness. --- diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py index 6a7e3647bfb1..3c6b481028a6 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):