Have pkgutil properly close files.

This commit is contained in:
Brett Cannon 2010-10-29 22:36:53 +00:00
parent 5c035c0949
commit 1ab58dfb12

View File

@ -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: