Skip to content

Commit 416d4d5

Browse files
Apply ruff/refurb rule FURB188
FURB188 Prefer `str.removeprefix()` over conditionally replacing with slice.
1 parent 83542c0 commit 416d4d5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

testing/cffi1/test_recompiler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,7 @@ def test_unpack_args():
893893
e7 = pytest.raises(TypeError, lib.foo2, 45, 46, 47)
894894
def st1(s):
895895
s = str(s)
896-
if s.startswith("_CFFI_test_unpack_args.Lib."):
897-
s = s[len("_CFFI_test_unpack_args.Lib."):]
896+
s = s.removeprefix("_CFFI_test_unpack_args.Lib.")
898897
return s
899898
assert st1(e1.value) == "foo0() takes no arguments (1 given)"
900899
assert st1(e2.value) == "foo0() takes no arguments (2 given)"

0 commit comments

Comments
 (0)