1
0

don't use bare except

use "except Exception", or if really needed explicitly "except BaseException"
This commit is contained in:
SomberNight
2023-04-23 01:33:12 +00:00
parent 6848b8f375
commit 312f2641e7
57 changed files with 118 additions and 118 deletions

View File

@@ -35,14 +35,14 @@ _ = lambda x:x # i18n
def parse_bip21(text):
try:
return util.parse_URI(text)
except:
except Exception:
return
def parse_bolt11(text):
from electrum.lnaddr import lndecode
try:
return lndecode(text)
except:
except Exception:
return
@@ -594,7 +594,7 @@ class ElectrumGui(BaseElectrumGui, EventListener):
def parse_amount(self, text):
try:
x = Decimal(text)
except:
except Exception:
return None
power = pow(10, self.config.get_decimal_point())
return int(power * x)