Mercurial > cpython-lru_cache-weakref
diff Lib/importlib/_bootstrap.py @ 80944:bb94f6222fef
Issue #16719: Get rid of WindowsError. Use OSError instead
Patch by Serhiy Storchaka.
| author | Andrew Svetlov <andrew.svetlov@gmail.com> |
|---|---|
| date | Wed, 19 Dec 2012 14:33:35 +0200 |
| parents | 7260cf668dd7 |
| children | 7d69d04522e3 |
line wrap: on
line diff
--- a/Lib/importlib/_bootstrap.py Wed Dec 19 13:45:30 2012 +0200 +++ b/Lib/importlib/_bootstrap.py Wed Dec 19 14:33:35 2012 +0200 @@ -755,7 +755,7 @@ 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 @@ try: with cls._open_registry(key) as hkey: filepath = _winreg.QueryValue(hkey, "") - except WindowsError: + except OSError: return None return filepath
