diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-07 18:15:34 +0300 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2011-05-07 18:15:34 +0300 |
commit | 17736f19671fe9e3a1d0965abf6e0d022c3c7b7f (patch) | |
tree | 53cdecfea95a81b6ef7326980cf5e81328b32b06 /Lib/pkgutil.py | |
parent | 2c515bbdb8fc7fd4cc3d01151d0b8dd8d5adccfd (diff) | |
parent | 496564fe5be17057671a373f4a1126352823ece5 (diff) | |
download | cpython-17736f19671fe9e3a1d0965abf6e0d022c3c7b7f.tar.gz |
#12017: merge with 3.1.
Diffstat (limited to 'Lib/pkgutil.py')
-rw-r--r-- | Lib/pkgutil.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py index 0ec6ec5265..b48627565c 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: |