use 'v[0] == "c"' instead of 'v.startswith("c")'

This commit is contained in:
Mike Fährmann
2024-10-15 08:24:06 +02:00
parent d68bb78f44
commit 36883e458e
10 changed files with 24 additions and 20 deletions

View File

@@ -432,7 +432,7 @@ def cookiestxt_load(fp):
None, False,
domain,
domain_specified == "TRUE",
domain.startswith("."),
domain[0] == "." if domain else False,
path, False,
secure == "TRUE",
None if expires == "0" or not expires else expires,
@@ -458,9 +458,10 @@ def cookiestxt_store(fp, cookies):
name = cookie.name
value = cookie.value
domain = cookie.domain
write("\t".join((
cookie.domain,
"TRUE" if cookie.domain.startswith(".") else "FALSE",
domain,
"TRUE" if domain and domain[0] == "." else "FALSE",
cookie.path,
"TRUE" if cookie.secure else "FALSE",
"0" if cookie.expires is None else str(cookie.expires),