summaryrefslogtreecommitdiff
path: root/numpy/lib/_datasource.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/_datasource.py')
-rw-r--r--numpy/lib/_datasource.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/_datasource.py b/numpy/lib/_datasource.py
index 617acdac1..96d9af905 100644
--- a/numpy/lib/_datasource.py
+++ b/numpy/lib/_datasource.py
@@ -297,6 +297,7 @@ class DataSource (object):
copyfileobj(openedurl, f)
finally:
f.close()
+ openedurl.close()
except URLError:
raise URLError("URL not found: %s" % path)
else:
@@ -445,6 +446,7 @@ class DataSource (object):
if self._isurl(path):
try:
netfile = urlopen(path)
+ netfile.close()
del(netfile)
return True
except URLError: