diff --git a/skimage/io/_io.py b/skimage/io/_io.py index 6986cc0f..2a177076 100644 --- a/skimage/io/_io.py +++ b/skimage/io/_io.py @@ -133,9 +133,8 @@ def imread(fname, as_grey=False, plugin=None, flatten=None, with tempfile.NamedTemporaryFile(delete=False) as f: u = urllib2.urlopen(fname) f.write(u.read()) - f.close() - img = call_plugin('imread', f.name, plugin=plugin, **plugin_args) - os.remove(f.name) + img = call_plugin('imread', f.name, plugin=plugin, **plugin_args) + os.remove(f.name) else: img = call_plugin('imread', fname, plugin=plugin, **plugin_args)