Skip to content

Commit f4c41df

Browse files
committed
urequest: close socket on all exception types, not just OSError
1 parent 8952813 commit f4c41df

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

micropython/urllib.urequest/urllib/urequest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def urlopen(url, data=None, method="GET", headers={}):
6868
raise ValueError("Unsupported " + l)
6969
elif l.startswith(b"Location:"):
7070
raise NotImplementedError("Redirects not yet supported")
71-
except OSError:
71+
except Exception:
7272
s.close()
7373
raise
7474

0 commit comments

Comments
 (0)