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/urllib/request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/urllib/request.py') diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 6757bc6158..2ebd89260f 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -2573,7 +2573,7 @@ elif os.name == 'nt': proxies['https'] = 'https://%s' % proxyServer proxies['ftp'] = 'ftp://%s' % proxyServer internetSettings.Close() - except (WindowsError, ValueError, TypeError): + except (OSError, ValueError, TypeError): # Either registry key not found etc, or the value in an # unexpected format. # proxies already set up to be empty so nothing to do @@ -2603,7 +2603,7 @@ elif os.name == 'nt': proxyOverride = str(winreg.QueryValueEx(internetSettings, 'ProxyOverride')[0]) # ^^^^ Returned as Unicode but problems if not converted to ASCII - except WindowsError: + except OSError: return 0 if not proxyEnable or not proxyOverride: return 0 -- cgit v1.2.1