Skip to content

Commit dab9f8b

Browse files
Apply ruff:refurb rule FURB188
Prefer `str.removesuffix()` over conditionally replacing with slice.
1 parent 8118cb9 commit dab9f8b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

distutils/tests/test_core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ def test_run_setup_uses_current_dir(self, tmp_path):
101101
distutils.core.run_setup(setup_py)
102102

103103
output = sys.stdout.getvalue()
104-
if output.endswith("\n"):
105-
output = output[:-1]
104+
output = output.removesuffix("\n")
106105
assert cwd == output
107106

108107
def test_run_setup_within_if_main(self, temp_file):

0 commit comments

Comments
 (0)