Make use of str.removeprefix and .removesuffix (#85584)

This commit is contained in:
Ville Skyttä
2023-01-13 13:19:38 +02:00
committed by GitHub
parent d44210e573
commit ae302bbec0
24 changed files with 33 additions and 52 deletions

View File

@@ -225,7 +225,7 @@ def validate_or_move_away_sqlite_database(dburl: str) -> bool:
def dburl_to_path(dburl: str) -> str:
"""Convert the db url into a filesystem path."""
return dburl[len(SQLITE_URL_PREFIX) :]
return dburl.removeprefix(SQLITE_URL_PREFIX)
def last_run_was_recently_clean(cursor: CursorFetchStrategy) -> bool: