Skip to content

Commit f35f912

Browse files
committed
Apply ruff formatting
1 parent 5305908 commit f35f912

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

setuptools/command/build_ext.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ def _write_stub_file(self, stub_file: str, ext: Extension, compile=False):
342342
if compile and os.path.exists(stub_file):
343343
raise BaseError(stub_file + " already exists! Please delete.")
344344
if not self.dry_run:
345-
content = (
346-
'\n'.join([
345+
with open(stub_file, 'w', encoding="utf-8") as f:
346+
content = '\n'.join([
347347
"def __bootstrap__():",
348348
" global __bootstrap__, __file__, __loader__",
349349
" import sys, os, pkg_resources, importlib.util" + if_dl(", dl"),
@@ -367,8 +367,6 @@ def _write_stub_file(self, stub_file: str, ext: Extension, compile=False):
367367
"__bootstrap__()",
368368
"", # terminal \n
369369
])
370-
)
371-
with open(stub_file, 'w', encoding="utf-8") as f:
372370
f.write(content)
373371
if compile:
374372
self._compile_and_remove_stub(stub_file)

0 commit comments

Comments
 (0)