Be py3-ready

This commit is contained in:
Denis Silakov 2018-10-23 13:20:55 +03:00
parent 63f2ebb596
commit 8bba856e1e

View file

@ -89,7 +89,7 @@ class AbfJson(object):
def process_response(self, response_string):
try:
res = json.loads(response_string)
except ValueError, ex:
except ValueError as ex:
self.log.error(_("Internal server error: it has returned non-json data. "))
print(response_string)
exit(1)
@ -164,7 +164,7 @@ class AbfJson(object):
result = urllib2.urlopen(request)
res = result.read()
etag_new = result.headers.getheaders('ETag')[0]
except urllib2.HTTPError, ex:
except urllib2.HTTPError as ex:
if ex.code == 304: # data was not modified
res = cache_data.get(etag)
self.log.debug(_('Getting cached result (cache was validated)'))
@ -294,7 +294,7 @@ class AbfJson(object):
URL = self.file_store_url + '/api/v1/file_stores/' + sha_hash
try:
response = urllib2.urlopen(URL)
except urllib2.HTTPError, ex:
except urllib2.HTTPError as ex:
if ex.code == 404: # data was not modified
raise PageNotFoundError(_('File with hash %s can not be downloaded from File-Store.') % sha_hash)
else: