Browse Source

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

https://peps.python.org/pep-0604/
master
SomberNight 2 years ago
parent
commit
1736558e3d
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 4
      electrum/payment_identifier.py

4
electrum/payment_identifier.py

@ -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")

Loading…
Cancel
Save