1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Refs #34233 -- Used str.removeprefix()/removesuffix().

This commit is contained in:
Mariusz Felisiak
2023-01-18 19:11:18 +01:00
committed by GitHub
parent fd21f82aa8
commit 23e8868862
30 changed files with 42 additions and 53 deletions

View File

@@ -312,7 +312,7 @@ would override ``get_lookup`` with something like::
def get_lookup(self, lookup_name):
if lookup_name.startswith('x'):
try:
dimension = int(lookup_name[1:])
dimension = int(lookup_name.removeprefix("x"))
except ValueError:
pass
else: