diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-07-03 05:18:23 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-03 05:18:23 -0400 |
| commit | 213baae85f0b9c2640fdf7bf270f6b210f119c54 (patch) | |
| tree | fb743ec8d5b76f6bec0d3b0660887c03e43e974d /pkg_resources | |
| parent | 78928efa890109410b315b03a225c9fc5f041ff8 (diff) | |
| parent | ca0065fb62c1728cb42b86ae79375533856d2248 (diff) | |
| download | python-setuptools-git-213baae85f0b9c2640fdf7bf270f6b210f119c54.tar.gz | |
Merge pull request #2143 from pypa/distutils
Adopt distutils
Diffstat (limited to 'pkg_resources')
| -rw-r--r-- | pkg_resources/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 2c589d55..4ba49ec1 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -1458,7 +1458,8 @@ class NullProvider: script_filename = self._fn(self.egg_info, script) namespace['__file__'] = script_filename if os.path.exists(script_filename): - source = open(script_filename).read() + with open(script_filename) as fid: + source = fid.read() code = compile(source, script_filename, 'exec') exec(code, namespace, namespace) else: |
