Skip to content

Commit

Permalink
Update generic.py to repair the SyntaxWarning
Browse files Browse the repository at this point in the history
when start bottles from CLI
I get `generic.py:95: SyntaxWarning: invalid escape sequence '\d'`

reference the [python doc](https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals)
  • Loading branch information
TDYQ-Liu authored Feb 21, 2024
1 parent 89abf68 commit 1aefd67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bottles/backend/utils/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def sort_by_version(_list: list, extra_check: str = "async"):
def natural_keys(text):
result = [int(re.search(extra_check, text) is None)]
result.extend(
[int(t) if t.isdigit() else t.lower() for t in re.split("(\d+)", text)]
[int(t) if t.isdigit() else t.lower() for t in re.split(r"(\d+)", text)]
)
return result

Expand Down

0 comments on commit 1aefd67

Please sign in to comment.