core.lister_transports: Do not use bare except

This commit is contained in:
Antoine R. Dumont (@ardumont) 2018-07-27 11:28:44 +02:00
parent e62fea6def
commit 3e3b441646
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -84,7 +84,7 @@ class SWHListerHttpTransport(abc.ABC):
try:
# might be seconds
return True, float(retry_after)
except:
except Exception:
# might be http-date
at_date = datetime(*parsedate(retry_after)[:6])
from_now = (at_date - datetime.today()).total_seconds() + 5
@ -145,9 +145,9 @@ class SWHListerHttpTransport(abc.ABC):
s += '\n#\n'
try: # json?
s += pformat(response.json())
except: # not json
except Exception: # not json
try: # xml?
s += pformat(xmltodict.parse(response.text))
except: # not xml
except Exception: # not xml
s += pformat(response.text)
return s