Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions distutils/command/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ def _gen_temp_sourcefile(self, body, headers, lang):
filename = "_configtest" + LANG_EXT[lang]
with open(filename, "w", encoding='utf-8') as file:
if headers:
for header in headers:
file.write(f"#include <{header}>\n")
file.writelines(f"#include <{header}>\n" for header in headers)
file.write("\n")
file.write(body)
if body[-1] != "\n":
Expand Down
2 changes: 1 addition & 1 deletion distutils/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def parse_config_files(self, filenames=None): # noqa: C901
try:
if alias:
setattr(self, alias, not strtobool(val))
elif opt in ('verbose',): # ugh!
elif opt == 'verbose':
setattr(self, opt, strtobool(val))
else:
setattr(self, opt, val)
Expand Down
3 changes: 1 addition & 2 deletions distutils/tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ def test_run_setup_uses_current_dir(self, tmp_path):
distutils.core.run_setup(setup_py)

output = sys.stdout.getvalue()
if output.endswith("\n"):
output = output[:-1]
output = output.removesuffix("\n")
assert cwd == output

def test_run_setup_within_if_main(self, temp_file):
Expand Down
1 change: 1 addition & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ extend-select = [

# local
"B",
"FURB",
"ISC",
"PERF",
"RUF010",
Expand Down
Loading