mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
0bc3cc9bd9
Running setup.py using SETUPTOOLS_SHIM logs a ResourceWarning on Python 3 when using python3 -Wd command line option. This change fixes the warning by close the setup.py file before running it.
8 lines
278 B
Python
8 lines
278 B
Python
# Shim to wrap setup.py invocation with setuptools
|
|
SETUPTOOLS_SHIM = (
|
|
"import setuptools, tokenize;__file__=%r;"
|
|
"f=getattr(tokenize, 'open', open)(__file__);"
|
|
"code=f.read().replace('\\r\\n', '\\n');"
|
|
"f.close();"
|
|
"exec(compile(code, __file__, 'exec'))"
|
|
)
|