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

@@ -313,7 +313,7 @@ class Commands:
# call literal_eval for backward compatibility (see #4225)
try:
value = ast.literal_eval(value)
except:
except Exception:
pass
return value
@@ -631,7 +631,7 @@ class Commands:
"""Convert xtype of a master key. e.g. xpub -> ypub"""
try:
node = BIP32Node.from_xkey(xkey)
except:
except Exception:
raise Exception('xkey should be a master public/private key')
return node._replace(xtype=xtype).to_xkey()
@@ -1376,7 +1376,7 @@ def eval_bool(x: str) -> bool:
if x == 'true': return True
try:
return bool(ast.literal_eval(x))
except:
except Exception:
return bool(x)
param_descriptions = {