summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap_external.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-04-16 07:46:38 (GMT)
committerGitHub <noreply@github.com>2017-04-16 07:46:38 (GMT)
commit55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 (patch)
treec1b3aacf87240d393666321d49a5abde3e1d601f /Lib/importlib/_bootstrap_external.py
parentfdbd01151dbd5feea3e4c0316d102db3d2a2a412 (diff)
downloadcpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.zip
cpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.tar.gz
cpython-55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0.tar.bz2
bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051)
Diffstat (limited to 'Lib/importlib/_bootstrap_external.py')
-rw-r--r--Lib/importlib/_bootstrap_external.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index ec528b2..3235404 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -689,9 +689,9 @@ class SourceLoader(_LoaderBasics):
"""Optional method that returns the modification time (an int) for the
specified path, where path is a str.
- Raises IOError when the path cannot be handled.
+ Raises OSError when the path cannot be handled.
"""
- raise IOError
+ raise OSError
def path_stats(self, path):
"""Optional method returning a metadata dict for the specified path
@@ -702,7 +702,7 @@ class SourceLoader(_LoaderBasics):
- 'size' (optional) is the size in bytes of the source code.
Implementing this method allows the loader to read bytecode files.
- Raises IOError when the path cannot be handled.
+ Raises OSError when the path cannot be handled.
"""
return {'mtime': self.path_mtime(path)}
@@ -757,7 +757,7 @@ class SourceLoader(_LoaderBasics):
else:
try:
st = self.path_stats(source_path)
- except IOError:
+ except OSError:
pass
else:
source_mtime = int(st['mtime'])