mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Have pkgutil properly close files.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user