]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
While not strictly necessary thanks to the odd ABC inheritance done through
authorBrett Cannon <bcannon@gmail.com>
Sun, 22 Aug 2010 20:38:47 +0000 (20:38 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sun, 22 Aug 2010 20:38:47 +0000 (20:38 +0000)
importlib._bootstrap, add the optional methods for importlib.abc.SourceLoader
for completeness.

Lib/importlib/abc.py

index 6a7e3647bfb141fc346cb60e949e2c37be27c01b..3c6b481028a6741e33683855443206dffe3cdb27 100644 (file)
@@ -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):