Commit f7115e55 authored by Marius Gedminas's avatar Marius Gedminas

Fix ResourceWarning in importFile()

parent 0c53f08e
...@@ -75,7 +75,9 @@ class ExportImport: ...@@ -75,7 +75,9 @@ class ExportImport:
# This is tricky, because we need to work in a transaction! # This is tricky, because we need to work in a transaction!
if isinstance(f, six.string_types): if isinstance(f, six.string_types):
f = open(f, 'rb') with open(f, 'rb') as fp:
return self.importFile(fp, clue=clue,
customImporters=customImporters)
magic = f.read(4) magic = f.read(4)
if magic != b'ZEXP': if magic != b'ZEXP':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment