fix test warnings when using < python3.8 (#798)

* jinja warning

* fix regex

Co-authored-by: dni <dni.khr@gmail.com>
This commit is contained in:
dni ⚡
2022-07-28 12:15:27 +02:00
committed by GitHub
co-authored by dni
parent 04114c82f2
commit a3a183b86c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -61,7 +61,7 @@ def decode(pr: str) -> Invoice:
invoice = Invoice()
# decode the amount from the hrp
m = re.search("[^\d]+", hrp[2:])
m = re.search(r"[^\d]+", hrp[2:])
if m:
amountstr = hrp[2 + m.end() :]
if amountstr != "":
@@ -296,7 +296,7 @@ def _unshorten_amount(amount: str) -> int:
# BOLT #11:
# A reader SHOULD fail if `amount` contains a non-digit, or is followed by
# anything except a `multiplier` in the table above.
if not re.fullmatch("\d+[pnum]?", str(amount)):
if not re.fullmatch(r"\d+[pnum]?", str(amount)):
raise ValueError("Invalid amount '{}'".format(amount))
if unit in units: