core.lister_transports: Do not use bare except
This commit is contained in:
parent
e62fea6def
commit
3e3b441646
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue