From 2606a6f197a49f04611cb5cb0d67404d1ab14481 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Wed, 19 Dec 2012 14:33:35 +0200 Subject: Issue #16719: Get rid of WindowsError. Use OSError instead Patch by Serhiy Storchaka. --- Lib/importlib/_bootstrap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/importlib/_bootstrap.py') diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index 0c6252ebd6..3ea798d5bd 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -755,7 +755,7 @@ class WindowsRegistryFinder: def _open_registry(cls, key): try: return _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, key) - except WindowsError: + except OSError: return _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, key) @classmethod @@ -769,7 +769,7 @@ class WindowsRegistryFinder: try: with cls._open_registry(key) as hkey: filepath = _winreg.QueryValue(hkey, "") - except WindowsError: + except OSError: return None return filepath -- cgit v1.2.1