summaryrefslogtreecommitdiff
path: root/Lib/importlib/abc.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-16 10:46:38 +0300
committerGitHub <noreply@github.com>2017-04-16 10:46:38 +0300
commit55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 (patch)
treec1b3aacf87240d393666321d49a5abde3e1d601f /Lib/importlib/abc.py
parentfdbd01151dbd5feea3e4c0316d102db3d2a2a412 (diff)
downloadcpython-git-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.tar.gz
bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)
Diffstat (limited to 'Lib/importlib/abc.py')
-rw-r--r--Lib/importlib/abc.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py
index 661bd76e07..d7cadf2ee7 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -193,7 +193,7 @@ class ResourceLoader(Loader):
def get_data(self, path):
"""Abstract method which when implemented should return the bytes for
the specified path. The path must be a str."""
- raise IOError
+ raise OSError
class InspectLoader(Loader):
@@ -315,7 +315,7 @@ class SourceLoader(_bootstrap_external.SourceLoader, ResourceLoader, ExecutionLo
def path_mtime(self, path):
"""Return the (int) modification time for the path (str)."""
if self.path_stats.__func__ is SourceLoader.path_stats:
- raise IOError
+ raise OSError
return int(self.path_stats(path)['mtime'])
def path_stats(self, path):
@@ -326,7 +326,7 @@ class SourceLoader(_bootstrap_external.SourceLoader, ResourceLoader, ExecutionLo
- 'size' (optional) is the size in bytes of the source code.
"""
if self.path_mtime.__func__ is SourceLoader.path_mtime:
- raise IOError
+ raise OSError
return {'mtime': self.path_mtime(path)}
def set_data(self, path, data):