Make download_retry work with non-HTTP urls

urlopen() supports non-http URLs, but when called on them, http-related
features are absent - such as getcode().  Make the code work with file:///
URLs.
less-recipients
Steve Langasek 3 years ago
parent 0b4cd56d68
commit 3814d63666

@ -807,7 +807,7 @@ class AutopkgtestPolicy(BasePolicy):
try: try:
req = urlopen(url, timeout=30) req = urlopen(url, timeout=30)
code = req.getcode() code = req.getcode()
if 200 <= code < 300: if not code or 200 <= code < 300:
return req return req
except socket.timeout as e: except socket.timeout as e:
self.logger.info( self.logger.info(

Loading…
Cancel
Save