From 31c0e523c2f0e1654b2fe893a9620dfa30b56698 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Wed, 1 Aug 2012 15:30:16 +0200 Subject: [PATCH] Fix exeptions, replace 'as' by ',' as reported on IRC for Python 2.4.3 on Centos5 --- library/get_url | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/get_url b/library/get_url index bb125d94949..5f166629c93 100755 --- a/library/get_url +++ b/library/get_url @@ -77,11 +77,11 @@ def url_do_get(module, url, dest): r = urllib2.urlopen(request) info.update(r.info()) info.update(dict(msg="OK (%s bytes)" % r.headers.get('Content-Length', 'unknown'), status=200)) - except urllib2.HTTPError as e: + except urllib2.HTTPError, e: # Must not fail_json() here so caller can handle HTTP 304 unmodified info.update(dict(msg=str(e), status=e.code)) return r, info - except urllib2.URLError as e: + except urllib2.URLError, e: code = getattr(e, 'code', -1) module.fail_json(msg="Request failed: %s" % str(e), status_code=code)