summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/pkgutil.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index 0ec6ec5..b486275 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -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: