fix: invalid escape sequences in regex

This commit is contained in:
Ankush Menat
2021-09-01 15:25:49 +05:30
parent 55b24345a0
commit e46567192a
5 changed files with 7 additions and 6 deletions

View File

@@ -339,7 +339,7 @@ def sort_accounts(accounts, is_root=False, key="name"):
"""Sort root types as Asset, Liability, Equity, Income, Expense"""
def compare_accounts(a, b):
if re.split('\W+', a[key])[0].isdigit():
if re.split(r'\W+', a[key])[0].isdigit():
# if chart of accounts is numbered, then sort by number
return cmp(a[key], b[key])
elif is_root: