From 0a140668faf18bf7f8d2ea15e57da5e2a0625292 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 13 Jun 2013 20:57:26 -0400 Subject: Issue #18200: Update the stdlib (except tests) to use ModuleNotFoundError. --- Lib/urllib/request.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/urllib/request.py') diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 4765a942886..d54b9747fb1 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -110,7 +110,7 @@ from urllib.response import addinfourl, addclosehook # check for SSL try: import ssl -except ImportError: +except ModuleNotFoundError: _have_ssl = False else: _have_ssl = True @@ -2512,7 +2512,7 @@ elif os.name == 'nt': proxies = {} try: import winreg - except ImportError: + except ModuleNotFoundError: # Std module, so should be around - but you never know! return proxies try: @@ -2560,7 +2560,7 @@ elif os.name == 'nt': def proxy_bypass_registry(host): try: import winreg - except ImportError: + except ModuleNotFoundError: # Std modules, so should be around - but you never know! return 0 try: -- cgit v1.2.3