Have pkgutil properly close files.
This commit is contained in:
parent
5c035c0949
commit
1ab58dfb12
|
@ -241,7 +241,8 @@ class ImpLoader:
|
||||||
return mod
|
return mod
|
||||||
|
|
||||||
def get_data(self, pathname):
|
def get_data(self, pathname):
|
||||||
return open(pathname, "rb").read()
|
with open(pathname, "rb") as file:
|
||||||
|
return file.read()
|
||||||
|
|
||||||
def _reopen(self):
|
def _reopen(self):
|
||||||
if self.file and self.file.closed:
|
if self.file and self.file.closed:
|
||||||
|
|
Loading…
Reference in New Issue