mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #34233 -- Used str.removeprefix()/removesuffix().
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user