From 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 16 Apr 2017 10:46:38 +0300 Subject: =?UTF-8?q?bpo-30022:=20Get=20rid=20of=20using=20EnvironmentError?= =?UTF-8?q?=20and=20IOError=20(except=20test=E2=80=A6=20(#1051)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Lib/importlib/_bootstrap_external.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Lib/importlib/_bootstrap_external.py') diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index ec528b2f0d..32354042f6 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']) -- cgit v1.2.1