From 17a031da6ec2ee448ee3d8e18dde5c6a3785c464 Mon Sep 17 00:00:00 2001 From: Mike McCallister Date: Sat, 15 Oct 2011 16:21:01 -0500 Subject: Use urlopen from urllib2 instead of urllib so that HTTP errors will be caught. When using urllib.urlopen, no exception is thrown when the URL request receives a 403 error, for example. --- src/lib/Bcfg2Py3k.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/Bcfg2Py3k.py b/src/lib/Bcfg2Py3k.py index 606379d1f..4803bf8b2 100644 --- a/src/lib/Bcfg2Py3k.py +++ b/src/lib/Bcfg2Py3k.py @@ -12,7 +12,7 @@ try: from urllib2 import HTTPPasswordMgrWithDefaultRealm from urllib2 import build_opener from urllib2 import install_opener - from urllib import urlopen + from urllib2 import urlopen from urllib2 import HTTPError except ImportError: from urllib.parse import urljoin, urlparse -- cgit v1.2.3-1-g7c22