We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 574cb20 commit caf2e5aCopy full SHA for caf2e5a
setuptools/build_meta.py
@@ -99,14 +99,11 @@ def _patch_distutils_exec():
99
return
100
101
def _exec(code, global_vars):
102
- try:
103
- _, tmp = tempfile.mkstemp(suffix="setup.py")
104
- with open(tmp, "wb") as f:
105
- f.write(code)
106
- with tokenize.open(tmp) as f:
+ with tempfile.NamedTemporaryFile(suffix="setup.py") as tmp:
+ tmp.write(code)
+ tmp.close()
+ with tokenize.open(tmp.name) as f:
107
code = f.read().replace(r'\r\n', r'\n')
108
- finally:
109
- os.remove(tmp)
110
orig_exec(code, {**global_vars, "__name__": "__main__"})
111
112
distutils.core.exec = _exec
0 commit comments