While not strictly necessary thanks to the odd ABC inheritance done through

importlib._bootstrap, add the optional methods for importlib.abc.SourceLoader
for completeness.
This commit is contained in:
Brett Cannon 2010-08-22 20:38:47 +00:00
parent 2525dc8fb6
commit 8d18907a2e
1 changed files with 14 additions and 0 deletions

View 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):