From 1736558e3db75e07c51716bdd721b4e35db0e230 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 7 Feb 2024 11:03:55 +0000 Subject: [PATCH] type hints: follow-up prevprev. "union types as X | Y" needs py3.10 https://peps.python.org/pep-0604/ --- electrum/payment_identifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/electrum/payment_identifier.py b/electrum/payment_identifier.py index 8545e34bf..ce8698532 100644 --- a/electrum/payment_identifier.py +++ b/electrum/payment_identifier.py @@ -4,7 +4,7 @@ import urllib import re from decimal import Decimal, InvalidOperation 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 .contacts import AliasNotFoundException @@ -541,7 +541,7 @@ class PaymentIdentifier(Logger): script += construct_script([word]) return script - def parse_amount(self, x: str) -> str | int: + def parse_amount(self, x: str) -> Union[str, int]: x = x.strip() if not x: raise Exception("Amount is empty")