mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
Have pkgutil properly close files.
This commit is contained in:
parent
5c035c0949
commit
1ab58dfb12
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user