Commit 1ab58dfb authored by Brett Cannon's avatar Brett Cannon

Have pkgutil properly close files.

parent 5c035c09
......@@ -241,7 +241,8 @@ class ImpLoader:
return mod
def get_data(self, pathname):
return open(pathname, "rb").read()
with open(pathname, "rb") as file:
return file.read()
def _reopen(self):
if self.file and self.file.closed:
......
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