Fix except blocks using HTTP_ERRORS
The except blocks involving HTTP_ERRORS joined the exception types in a way that the types listed in HTTP_ERRORS appeared as a tuple, e.g. (ServersRetrievalError, (HTTPError, …))
This commit is contained in:
parent
6603954e45
commit
16746b775a
|
@ -1395,14 +1395,14 @@ def shell():
|
|||
printer('Retrieving speedtest.net configuration...', quiet)
|
||||
try:
|
||||
speedtest = Speedtest()
|
||||
except (ConfigRetrievalError, HTTP_ERRORS):
|
||||
except ((ConfigRetrievalError,) + HTTP_ERRORS):
|
||||
printer('Cannot retrieve speedtest configuration')
|
||||
raise SpeedtestCLIError(get_exception())
|
||||
|
||||
if args.list:
|
||||
try:
|
||||
speedtest.get_servers()
|
||||
except (ServersRetrievalError, HTTP_ERRORS):
|
||||
except ((ServersRetrievalError,) + HTTP_ERRORS):
|
||||
print_('Cannot retrieve speedtest server list')
|
||||
raise SpeedtestCLIError(get_exception())
|
||||
|
||||
|
@ -1432,7 +1432,7 @@ def shell():
|
|||
speedtest.get_servers(servers)
|
||||
except NoMatchedServers:
|
||||
raise SpeedtestCLIError('No matched servers: %s' % args.server)
|
||||
except (ServersRetrievalError, HTTP_ERRORS):
|
||||
except ((ServersRetrievalError,) + HTTP_ERRORS):
|
||||
print_('Cannot retrieve speedtest server list')
|
||||
raise SpeedtestCLIError(get_exception())
|
||||
except InvalidServerIDType:
|
||||
|
|
Loading…
Reference in New Issue