Skip to content

Commit e17859e

Browse files
committed
catch the parent exception instead
1 parent 82cf624 commit e17859e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

samples/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ def tobytearray(r):
3535
try:
3636
with urllib.request.urlopen(req, timeout=remaining) as response:
3737
encoded_sample = tobytearray(response.read())
38-
except (http.client.RemoteDisconnected, socket.timeout, urllib.error.HTTPError):
38+
except (
39+
http.client.RemoteDisconnected,
40+
socket.timeout,
41+
urllib.error.URLError,
42+
):
3943
time.sleep(wait)
4044
wait *= 2
4145
backoff += 1

0 commit comments

Comments
 (0)