Skip to content

Commit 9f6dfbb

Browse files
committed
FIX: Do not close seekable URL streams
1 parent 6e098c8 commit 9f6dfbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nibabel/filebasedimages.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -604,5 +604,5 @@ def from_url(klass, url, timeout=5):
604604
url : str or urllib.request.Request object
605605
URL of file to retrieve
606606
"""
607-
with request.urlopen(url, timeout=timeout) as response:
608-
return klass._from_iobase(response)
607+
response = request.urlopen(url, timeout=timeout)
608+
return klass._from_iobase(response)

0 commit comments

Comments
 (0)