1
0

type hints: follow-up prevprev. "union types as X | Y" needs py3.10

https://peps.python.org/pep-0604/
This commit is contained in:
SomberNight
2024-02-07 11:03:55 +00:00
parent d2ace95f96
commit 1736558e3d

View File

@@ -4,7 +4,7 @@ import urllib
import re import re
from decimal import Decimal, InvalidOperation from decimal import Decimal, InvalidOperation
from enum import IntEnum from enum import IntEnum
from typing import NamedTuple, Optional, Callable, List, TYPE_CHECKING, Tuple from typing import NamedTuple, Optional, Callable, List, TYPE_CHECKING, Tuple, Union
from . import bitcoin from . import bitcoin
from .contacts import AliasNotFoundException from .contacts import AliasNotFoundException
@@ -541,7 +541,7 @@ class PaymentIdentifier(Logger):
script += construct_script([word]) script += construct_script([word])
return script return script
def parse_amount(self, x: str) -> str | int: def parse_amount(self, x: str) -> Union[str, int]:
x = x.strip() x = x.strip()
if not x: if not x:
raise Exception("Amount is empty") raise Exception("Amount is empty")