diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-18 19:11:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 19:11:18 +0100 |
commit | 23e886886249ebe8f80a48b0d25fbb5308eeb06f (patch) | |
tree | ddd2eb220750704fa4fbfd8447654fc3d382bd10 /tests/forms_tests | |
parent | fd21f82aa82b0d75a161f618ef944ebe0923e0ab (diff) | |
download | django-23e886886249ebe8f80a48b0d25fbb5308eeb06f.tar.gz |
Refs #34233 -- Used str.removeprefix()/removesuffix().
Diffstat (limited to 'tests/forms_tests')
-rw-r--r-- | tests/forms_tests/field_tests/test_filepathfield.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/tests/forms_tests/field_tests/test_filepathfield.py b/tests/forms_tests/field_tests/test_filepathfield.py index ca0f6f3a7a..092001b453 100644 --- a/tests/forms_tests/field_tests/test_filepathfield.py +++ b/tests/forms_tests/field_tests/test_filepathfield.py @@ -9,9 +9,7 @@ PATH = os.path.dirname(os.path.abspath(__file__)) def fix_os_paths(x): if isinstance(x, str): - if x.startswith(PATH): - x = x[len(PATH) :] - return x.replace("\\", "/") + return x.removeprefix(PATH).replace("\\", "/") elif isinstance(x, tuple): return tuple(fix_os_paths(list(x))) elif isinstance(x, list): |