diff options
author | wim glenn <wim.glenn@gmail.com> | 2018-06-25 12:42:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-25 12:42:00 -0500 |
commit | d8bd6dde9378c58daf71bf88d805ae0d4b5e03dc (patch) | |
tree | c20bcacd4d2b5cfa425160c9ce97cca9d7f632e5 | |
parent | 16187afb3f532199f4951801d4e39939c560facc (diff) | |
download | external_python_setuptools-d8bd6dde9378c58daf71bf88d805ae0d4b5e03dc.tar.gz external_python_setuptools-d8bd6dde9378c58daf71bf88d805ae0d4b5e03dc.tar.bz2 external_python_setuptools-d8bd6dde9378c58daf71bf88d805ae0d4b5e03dc.zip |
Avoid resource warning from dev scripts installed editable
Avoid ` ResourceWarning: unclosed file <_io.TextIOWrapper name='whatever' mode='r' encoding='UTF-8'>` on dev scripts installed editable
-rw-r--r-- | setuptools/script (dev).tmpl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/setuptools/script (dev).tmpl b/setuptools/script (dev).tmpl index d58b1bb5..39a24b04 100644 --- a/setuptools/script (dev).tmpl +++ b/setuptools/script (dev).tmpl @@ -2,4 +2,5 @@ __requires__ = %(spec)r __import__('pkg_resources').require(%(spec)r) __file__ = %(dev_path)r -exec(compile(open(__file__).read(), __file__, 'exec')) +with open(__file__) as f: + exec(compile(f.read(), __file__, 'exec')) |