From b43fc87e3a601346d34fb3a0722f9e1b844f2f45 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 26 Oct 2026 13:36:41 +0000 Subject: [PATCH] ruff: except: -> except Exception: --- mmgen/addr.py | 2 +- mmgen/altcoin/params.py | 2 +- mmgen/autosign/__init__.py | 10 +++++----- mmgen/baseconv.py | 2 +- mmgen/cfg.py | 4 ++-- mmgen/cfgfile.py | 2 +- mmgen/daemon.py | 2 +- mmgen/fileutil.py | 8 ++++---- mmgen/main.py | 2 +- mmgen/main_msg.py | 2 +- mmgen/main_tool.py | 2 +- mmgen/main_txsend.py | 2 +- mmgen/proto/btc/rpc/local.py | 2 +- mmgen/proto/btc/tw/json.py | 2 +- mmgen/proto/btc/tx/new.py | 2 +- mmgen/proto/btc/tx/status.py | 10 +++++----- mmgen/proto/eth/contract.py | 2 +- mmgen/rpc/local.py | 6 +++--- mmgen/term.py | 8 ++++---- mmgen/tool/__init__.py | 2 +- mmgen/tw/store.py | 4 ++-- mmgen/tx/data_output.py | 4 ++-- mmgen/tx/file.py | 2 +- mmgen/tx/info.py | 2 +- mmgen/ui.py | 2 +- mmgen/util.py | 8 ++++---- mmgen/util2.py | 2 +- mmgen/xmrwallet/ops/spec.py | 2 +- mmgen/xmrwallet/rpc.py | 2 +- test/cmdtest.py | 6 +++--- test/cmdtest_d/autosign.py | 2 +- test/cmdtest_d/base.py | 2 +- test/gentest.py | 2 +- test/include/common.py | 6 +++--- test/include/unit_test.py | 2 +- test/objtest.py | 2 +- test/tooltest.py | 4 ++-- test/tooltest2.py | 6 +++--- 38 files changed, 67 insertions(+), 67 deletions(-) diff --git a/mmgen/addr.py b/mmgen/addr.py index a17a447a..12a06d52 100644 --- a/mmgen/addr.py +++ b/mmgen/addr.py @@ -110,7 +110,7 @@ class AddrListID(HiliteStr, InitErrors, MMGenObject): sid = SeedID(sid=a) try: mmtype = MMGenAddrType(proto=proto, id_str=b) - except: + except Exception: mmtype = MMGenPasswordType(proto=proto, id_str=b) else: assert isinstance(sid, SeedID), f'{sid!r} not a SeedID instance' diff --git a/mmgen/altcoin/params.py b/mmgen/altcoin/params.py index feb56987..17367242 100644 --- a/mmgen/altcoin/params.py +++ b/mmgen/altcoin/params.py @@ -258,7 +258,7 @@ class CoinInfo: def get_entry(cls, coin, network): try: idx = [e.symbol for e in cls.coin_constants[network]].index(coin.upper()) - except: + except Exception: return None return cls.coin_constants[network][idx] diff --git a/mmgen/autosign/__init__.py b/mmgen/autosign/__init__.py index 981d9ed9..80de9a20 100644 --- a/mmgen/autosign/__init__.py +++ b/mmgen/autosign/__init__.py @@ -186,7 +186,7 @@ class Autosign: try: dirlist = self.wallet_dir.iterdir() - except: + except Exception: die(1, f'Cannot open wallet directory ‘{self.wallet_dir}’. ' 'Did you run ‘mmgen-autosign setup’?') @@ -330,7 +330,7 @@ class Autosign: try: self.keyfile.write_text(os.urandom(32).hex()) self.keyfile.chmod(0o400) - except: + except Exception: die(2, 'Unable to write ' + desc) msg('Wrote ' + desc) @@ -367,17 +367,17 @@ class Autosign: import shutil try: shutil.rmtree(self.wallet_dir) - except: + except Exception: pass def create_wallet_dir(): try: self.wallet_dir.mkdir(parents=True) - except: + except Exception: pass try: self.wallet_dir.stat() - except: + except Exception: die(2, f'Unable to create wallet directory ‘{self.wallet_dir}’') self.gen_key(no_unmount=True) diff --git a/mmgen/baseconv.py b/mmgen/baseconv.py index a9539b4a..ab31f097 100644 --- a/mmgen/baseconv.py +++ b/mmgen/baseconv.py @@ -32,7 +32,7 @@ def is_mmgen_mnemonic(s): try: baseconv('mmgen').tobytes(s.split(), pad='seed') return True - except: + except Exception: return False class baseconv: diff --git a/mmgen/cfg.py b/mmgen/cfg.py index ac298e9b..0e119748 100644 --- a/mmgen/cfg.py +++ b/mmgen/cfg.py @@ -840,7 +840,7 @@ def check_opts(cfg): # Raises exception if any check fails case 'hidden_incog_output_params': try: os.stat(fn) - except: + except Exception: b = os.path.dirname(fn) if b: check_outdir(b) @@ -969,5 +969,5 @@ def conv_type(name, val, refval, *, src, invert_bool=False): else: try: return type(refval)(not val if invert_bool else val) - except: + except Exception: do_fail() diff --git a/mmgen/cfgfile.py b/mmgen/cfgfile.py index f67aedf9..5916c6a3 100644 --- a/mmgen/cfgfile.py +++ b/mmgen/cfgfile.py @@ -58,7 +58,7 @@ class cfg_file: with open(fn, 'w') as fp: fp.write('\n'.join(data)+'\n') os.chmod(fn, 0o600) - except: + except Exception: die(2, f'ERROR: unable to write to {fn!r}') def parse_value(self, value, refval): diff --git a/mmgen/daemon.py b/mmgen/daemon.py index 35552320..84bc506a 100644 --- a/mmgen/daemon.py +++ b/mmgen/daemon.py @@ -172,7 +172,7 @@ class Daemon(Lockable): def state_msg(self, *, extra_text=None): try: pid = self.pid - except: + except Exception: pid = None extra_text = 'not ' if self.state == 'stopped' else f'{extra_text} ' if extra_text else '' return '{:{w}} {:10} {}'.format( diff --git a/mmgen/fileutil.py b/mmgen/fileutil.py index b9ebc9f5..547a8cd2 100644 --- a/mmgen/fileutil.py +++ b/mmgen/fileutil.py @@ -48,7 +48,7 @@ def check_binary(args): from subprocess import run, DEVNULL try: run(args, stdout=DEVNULL, stderr=DEVNULL, check=True) - except: + except Exception: die(2, f'{args[0]!r} binary missing, not in path, or not executable') def shred_file(cfg, fn, *, iterations=30): @@ -137,7 +137,7 @@ def get_seed_file(cfg, *, nargs, wallets=None, invoked_as=None): def _open_or_die(filename, mode, *, silent=False): try: return open(filename, mode) - except: + except Exception: if silent: die(2, '') else: @@ -216,7 +216,7 @@ def write_data_to_file( # MSWin workaround. See msg_r() try: sys.stdout.write(data.decode() if isinstance(data, bytes) else data) - except: + except Exception: os.write(1, data if isinstance(data, bytes) else data.encode()) def do_file(outfile, ask_write_prompt): @@ -260,7 +260,7 @@ def write_data_to_file( try: with _open_or_die(outfile, 'wb') as fp: fp.write(data if binary else data.encode()) - except: + except Exception: die(2, f'Failed to write {desc} to file {outfile!r}') if not (hush or quiet): diff --git a/mmgen/main.py b/mmgen/main.py index cfbdec61..8f195093 100644 --- a/mmgen/main.py +++ b/mmgen/main.py @@ -41,7 +41,7 @@ def launch(*, mod=None, func=None, fqmod=None, package='mmgen'): except Exception as e: try: errmsg = str(e.args[0]) - except: + except Exception: errmsg = repr(e.args[0]) if e.args else repr(e) from collections import namedtuple diff --git a/mmgen/main_msg.py b/mmgen/main_msg.py index 61a123e8..ccd19f5f 100644 --- a/mmgen/main_msg.py +++ b/mmgen/main_msg.py @@ -61,7 +61,7 @@ class MsgOps: async def __init__(self, msgfile, *, addr=None): try: m = SignedOnlineMsg(cfg, infile=msgfile) - except: + except Exception: m = ExportedMsgSigs(cfg, infile=msgfile) nSigs = await m.verify(addr=addr) diff --git a/mmgen/main_tool.py b/mmgen/main_tool.py index 37dfba38..194a6d41 100644 --- a/mmgen/main_tool.py +++ b/mmgen/main_tool.py @@ -219,7 +219,7 @@ def process_result(ret, *, pager=False, print_result=False): case bytes(): try: return triage_result(ret.decode()) - except: + except Exception: # don't add NL to binary data if it can't be converted to utf8 return os.write(1, ret) if print_result else ret case _: diff --git a/mmgen/main_txsend.py b/mmgen/main_txsend.py index 13189d9f..11823634 100644 --- a/mmgen/main_txsend.py +++ b/mmgen/main_txsend.py @@ -121,7 +121,7 @@ def init_autosign(arg): elif post_send_op: try: tx_range = SentTXRange(arg) - except: + except Exception: die(2, f'{arg}: invalid transaction index arg ' '(must be a non-negative integer or hyphen-separated range)') else: diff --git a/mmgen/proto/btc/rpc/local.py b/mmgen/proto/btc/rpc/local.py index b01c6453..e505022b 100644 --- a/mmgen/proto/btc/rpc/local.py +++ b/mmgen/proto/btc/rpc/local.py @@ -357,7 +357,7 @@ class BitcoinRPCClient(RPCClient, metaclass=AsyncInit): try: lines = get_lines_from_file( self.cfg, fn, desc='daemon config file', silent=not self.cfg.verbose) - except: + except Exception: self.cfg._util.vmsg(f'Warning: {fn!r} does not exist or is unreadable') return {k: None for k in req_keys} diff --git a/mmgen/proto/btc/tw/json.py b/mmgen/proto/btc/tw/json.py index 3eebf274..9144f806 100644 --- a/mmgen/proto/btc/tw/json.py +++ b/mmgen/proto/btc/tw/json.py @@ -54,7 +54,7 @@ class BitcoinTwJSON(TwJSON): try: await self.twctl.rpc.check_or_create_daemon_wallet() return True - except: + except Exception: return False async def get_entries(self): diff --git a/mmgen/proto/btc/tx/new.py b/mmgen/proto/btc/tx/new.py index a6650fd9..e110e334 100644 --- a/mmgen/proto/btc/tx/new.py +++ b/mmgen/proto/btc/tx/new.py @@ -57,7 +57,7 @@ class New(Base, TxNew): self.cfg.fee_estimate_mode.upper()) fee_per_kb = self.proto.coin_amt(ret['feerate']) if 'feerate' in ret else None fe_type = 'estimatesmartfee' - except: + except Exception: args = self.rpc.daemon.estimatefee_args(self.rpc) ret = await self.rpc.call('estimatefee', *args) fee_per_kb = self.proto.coin_amt(ret) diff --git a/mmgen/proto/btc/tx/status.py b/mmgen/proto/btc/tx/status.py index ca343fff..18ff5ed7 100644 --- a/mmgen/proto/btc/tx/status.py +++ b/mmgen/proto/btc/tx/status.py @@ -38,7 +38,7 @@ class Status(TxBase.Status): txid = tx.coin_txid, include_watchonly = True, verbose = False) - except: + except Exception: return False if ret.get('confirmations', 0) > 0: r.confs = ret['confirmations'] @@ -49,14 +49,14 @@ class Status(TxBase.Status): async def is_in_utxos(): try: return 'txid' in await tx.rpc.call('getrawtransaction', tx.coin_txid, True) - except: + except Exception: return False async def is_in_mempool(): try: await tx.rpc.call('getmempoolentry', tx.coin_txid) return True - except: + except Exception: return False async def is_replaced(): @@ -68,7 +68,7 @@ class Status(TxBase.Status): txid = tx.coin_txid, include_watchonly = True, verbose = False) - except: + except Exception: return False else: if 'bip125-replaceable' in ret and ret.get('confirmations', 1) <= 0: @@ -108,7 +108,7 @@ class Status(TxBase.Status): for txid in r.replacing_txs: try: d.append(await tx.rpc.call('getmempoolentry', txid)) - except: + except Exception: d.append({}) for txid, mp_entry in zip(r.replacing_txs, d): msg(f' {txid}' + (' in mempool' if 'height' in mp_entry else '')) diff --git a/mmgen/proto/eth/contract.py b/mmgen/proto/eth/contract.py index 4eb388f9..88529a46 100644 --- a/mmgen/proto/eth/contract.py +++ b/mmgen/proto/eth/contract.py @@ -150,7 +150,7 @@ class Token(Contract): try: assert ret.startswith('0x') return int(ret, 16) - except: + except Exception: msg(f'RPC call to decimals() failed (returned {ret!r})') async def get_total_supply(self): diff --git a/mmgen/rpc/local.py b/mmgen/rpc/local.py index 093ce3b2..5409f55e 100644 --- a/mmgen/rpc/local.py +++ b/mmgen/rpc/local.py @@ -167,7 +167,7 @@ class RPCClient: return ret else: return json.loads(text, parse_float=float_parser) - except: + except Exception: if not m: t = json.loads(text) try: @@ -184,10 +184,10 @@ class RPCClient: if text: try: m = json.loads(text)['error']['message'] - except: + except Exception: try: m = text.decode() - except: + except Exception: m = text die('RPCFailure', f'{s.value} {s.name}: {m}') diff --git a/mmgen/term.py b/mmgen/term.py index bd7c9fc2..77296806 100644 --- a/mmgen/term.py +++ b/mmgen/term.py @@ -105,12 +105,12 @@ class MMGenTermLinux(MMGenTerm): def get_terminal_size(cls): try: ret = os.get_terminal_size() - except: + except Exception: try: ret = ( int(os.environ['COLUMNS']), int(os.environ['LINES'])) - except: + except Exception: ret = (80, 25) return _term_dimensions(*ret) @@ -207,7 +207,7 @@ class MMGenTermMSWin(MMGenTerm): left, top, right, bottom = struct.unpack('hhhhHhhhhhh', csbi.raw)[5:9] x = right - left + 1 y = bottom - top + 1 - except: + except Exception: pass if x and y: @@ -276,7 +276,7 @@ class MMGenTermMSWinStub(MMGenTermMSWin): while True: try: return sys.stdin.read(1) - except: + except Exception: msg('[read error, trying again]') time.sleep(0.5) diff --git a/mmgen/tool/__init__.py b/mmgen/tool/__init__.py index 73242a87..6f25d743 100644 --- a/mmgen/tool/__init__.py +++ b/mmgen/tool/__init__.py @@ -132,7 +132,7 @@ def process_args(cmd, cmd_args, cls): try: return __builtins__[arg_type](arg) - except: + except Exception: die(1, f'{arg!r}: Invalid argument for argument {arg_name} ({arg_type!r} required)') if flag == 'VAR_ARGS': diff --git a/mmgen/tw/store.py b/mmgen/tw/store.py index db502bb2..bb9f5cbf 100644 --- a/mmgen/tw/store.py +++ b/mmgen/tw/store.py @@ -100,10 +100,10 @@ class TwCtlWithStore(TwCtl): try: self.orig_data = get_data_from_file(self.cfg, self.tw_path, quiet=True) self.data = json.loads(self.orig_data) - except: + except Exception: try: self.tw_path.stat() - except: + except Exception: self.orig_data = '' self.init_empty() self.force_write() diff --git a/mmgen/tx/data_output.py b/mmgen/tx/data_output.py index 58c79d96..7ac5bd20 100644 --- a/mmgen/tx/data_output.py +++ b/mmgen/tx/data_output.py @@ -29,7 +29,7 @@ class DataOutput(bytes, InitErrors): elif data_spec.startswith('data:'): try: ret = data_spec[5:].encode('utf8') - except: + except Exception: raise ValueError(f'{cls.desc} value must be UTF-8 encoded') else: raise ValueError(f'{cls.desc} argument must start with ‘data:’ or ‘hexdata:’') @@ -53,7 +53,7 @@ class DataOutput(bytes, InitErrors): self.display_hex = True try: ret = self.decode('utf8') - except: + except Exception: return self.hex() else: import unicodedata diff --git a/mmgen/tx/file.py b/mmgen/tx/file.py index b6254177..2430fdce 100644 --- a/mmgen/tx/file.py +++ b/mmgen/tx/file.py @@ -161,7 +161,7 @@ class MMGenTxFile(MMGenObject): from ast import literal_eval try: return literal_eval(raw_data) - except: + except Exception: if desc == 'inputs': ymsg('Warning: transaction data appears to be in old format') import re diff --git a/mmgen/tx/info.py b/mmgen/tx/info.py index 882f9739..c3c759ac 100644 --- a/mmgen/tx/info.py +++ b/mmgen/tx/info.py @@ -57,7 +57,7 @@ class TxInfo: else: try: blockcount = tx.rpc.blockcount - except: + except Exception: blockcount = None def get_max_mmwid(io): diff --git a/mmgen/ui.py b/mmgen/ui.py index e591815c..acd9e285 100644 --- a/mmgen/ui.py +++ b/mmgen/ui.py @@ -207,7 +207,7 @@ def do_pager(text): input = text.encode() if pager == 'less' else (text + end_msg).encode(), check = True) msg_r('\r') - except: + except Exception: pass else: break diff --git a/mmgen/util.py b/mmgen/util.py index 14a09d9d..14d1b923 100644 --- a/mmgen/util.py +++ b/mmgen/util.py @@ -101,7 +101,7 @@ if gc.platform == 'win32': try: gv.stderr.write(s) gv.stderr.flush() - except: + except Exception: os.write(2, s.encode()) def msg(s): @@ -111,7 +111,7 @@ if gc.platform == 'win32': try: gv.stdout.write(s) gv.stdout.flush() - except: + except Exception: os.write(1, s.encode()) def Msg(s): @@ -392,7 +392,7 @@ def is_hex_str_lc(s): def is_utf8(s): try: s.decode('utf8') - except: + except Exception: return False else: return True @@ -490,7 +490,7 @@ def have_sudo(*, silent=False): try: run(['sudo', '--non-interactive', 'true'], stdout=redir, stderr=redir, check=True) return True - except: + except Exception: return False def distro_codename(): diff --git a/mmgen/util2.py b/mmgen/util2.py index 98ce3b78..2888704c 100644 --- a/mmgen/util2.py +++ b/mmgen/util2.py @@ -224,7 +224,7 @@ def decode_pretty_hexdump(data): lines = [pat.sub('', line) for line in data.splitlines()] try: return bytes.fromhex(''.join(''.join(lines).split())) - except: + except Exception: msg('Data not in hexdump format') return False diff --git a/mmgen/xmrwallet/ops/spec.py b/mmgen/xmrwallet/ops/spec.py index b732955e..fe689b9b 100644 --- a/mmgen/xmrwallet/ops/spec.py +++ b/mmgen/xmrwallet/ops/spec.py @@ -33,7 +33,7 @@ class OpMixinSpec: idx = int(m[i]) try: res = self.kal.entry(idx) - except: + except Exception: die(1, 'Supplied key-address file does not contain address ' f'{self.kal.al_id.sid}:{idx}') diff --git a/mmgen/xmrwallet/rpc.py b/mmgen/xmrwallet/rpc.py index 094fd528..419ae2e7 100644 --- a/mmgen/xmrwallet/rpc.py +++ b/mmgen/xmrwallet/rpc.py @@ -202,5 +202,5 @@ class MoneroWalletRPC: ret = self.c.call('relay_tx', hex=tx_hex) try: msg('\n Relayed {}'.format(CoinTxID(ret['tx_hash']).hl())) - except: + except Exception: msg(f'\n Server returned: {ret!s}') diff --git a/test/cmdtest.py b/test/cmdtest.py index e4dc3a1a..d998af3b 100755 --- a/test/cmdtest.py +++ b/test/cmdtest.py @@ -34,15 +34,15 @@ def create_shm_dir(data_dir, autosign_data_dir, trash_dir, trash_dir2): for tdir in (data_dir, autosign_data_dir, trash_dir, trash_dir2): try: os.listdir(tdir) - except: + except Exception: pass else: try: shutil.rmtree(tdir) - except: # we couldn't remove data dir - perhaps regtest daemon is running + except Exception: # we couldn't remove data dir - perhaps regtest daemon is running try: run(['python3', os.path.join('cmds', 'mmgen-regtest'), 'stop'], check=True) - except: + except Exception: die(4, f'Unable to remove {tdir!r}!') else: time.sleep(2) diff --git a/test/cmdtest_d/autosign.py b/test/cmdtest_d/autosign.py index a6ba4541..82b5c5cd 100644 --- a/test/cmdtest_d/autosign.py +++ b/test/cmdtest_d/autosign.py @@ -182,7 +182,7 @@ class CmdTestAutosignBase(CmdTestBase): def _macOS_eject_disk(self, label): try: run(['diskutil' , 'eject', label], stdout=DEVNULL, stderr=DEVNULL) - except: + except Exception: pass def start_daemons(self): diff --git a/test/cmdtest_d/base.py b/test/cmdtest_d/base.py index 75609f97..bd79f79a 100644 --- a/test/cmdtest_d/base.py +++ b/test/cmdtest_d/base.py @@ -98,7 +98,7 @@ class CmdTestBase: fn = os.path.join(self.tmpdir, fn) try: return os.unlink(fn) - except: + except Exception: msg(f'{fn}: file does not exist or could not be deleted') def skip_on_condition(self, condition, message, extra_msg): diff --git a/test/gentest.py b/test/gentest.py index 732815f1..d60c564a 100755 --- a/test/gentest.py +++ b/test/gentest.py @@ -465,7 +465,7 @@ def dump_test(proto, kg, ag, filename): qmsg_r(f'\rKey {count}/{len(dump)} ') try: b_sec = PrivKey(proto, wif=b_wif) - except: + except Exception: die(2, f'\nInvalid {proto.network} WIF address in dump file: {b_wif}') a_addr = ag.to_addr(kg.gen_data(b_sec)) vmsg(f'\nwif: {b_wif}\naddr: {b_addr}\n') diff --git a/test/include/common.py b/test/include/common.py index c94435de..7b654ea0 100644 --- a/test/include/common.py +++ b/test/include/common.py @@ -138,7 +138,7 @@ def cleandir(d, do_msg=False): try: files = os.listdir(d_enc) - except: + except Exception: return None if files: @@ -148,7 +148,7 @@ def cleandir(d, do_msg=False): for f in files: try: os.unlink(os.path.join(d_enc, f)) - except: + except Exception: rmtree(os.path.join(d_enc, f), ignore_errors=True) return files @@ -406,7 +406,7 @@ class VirtBlockDeviceBase: def try_detach(self): try: dev = self.dev - except: + except Exception: pass else: self.do_detach(dev, check=False) diff --git a/test/include/unit_test.py b/test/include/unit_test.py index e2b496e5..03b9553e 100644 --- a/test/include/unit_test.py +++ b/test/include/unit_test.py @@ -185,7 +185,7 @@ def run_test(test, subtest=None): if do_desc and not cfg.quiet: msg('OK\n' if cfg.verbose else 'OK') - except: + except Exception: if getattr(t, 'silence_output', False): end_silence() raise diff --git a/test/objtest.py b/test/objtest.py index ad743a49..ecb1409d 100755 --- a/test/objtest.py +++ b/test/objtest.py @@ -151,7 +151,7 @@ def run_test(mod, test, arg, input_data, arg1, exc_name): else: try: ret_disp = ret.decode() - except: + except Exception: ret_disp = ret msg(f'==> {ret_disp!r}') diff --git a/test/tooltest.py b/test/tooltest.py index d6dd435a..6d771629 100755 --- a/test/tooltest.py +++ b/test/tooltest.py @@ -271,7 +271,7 @@ class MMGenToolTestUtils: from test.include.common import dmsg try: dmsg(err.decode()) - except: + except Exception: dmsg(repr(err)) if not binary: out = out.decode() @@ -354,7 +354,7 @@ tu = MMGenToolTestUtils() def ok_or_die(val, chk_func, s, skip_ok=False): try: ret = chk_func(val) - except: + except Exception: ret = False if ret: if not skip_ok: diff --git a/test/tooltest2.py b/test/tooltest2.py index 6c432eb5..cd0e8846 100755 --- a/test/tooltest2.py +++ b/test/tooltest2.py @@ -94,7 +94,7 @@ def fork_cmd(cmd_name, args, opts, stdin_input): cp = run(cmd, input=stdin_input or None, capture_output=True) try: cmd_out = cp.stdout.decode() - except: + except Exception: cmd_out = cp.stdout if cp.stderr: vmsg(cp.stderr.strip().decode()) @@ -162,7 +162,7 @@ def check_output(out, chk): try: outd = out.decode() - except: + except Exception: outd = None err_fs = "Output ({!r}) doesn't match expected output ({!r})" @@ -242,7 +242,7 @@ def run_test(cls, gid, cmd_name): try: vmsg(f'Output:\n{cmd_out}\n') - except: + except Exception: vmsg(f'Output:\n{cmd_out!r}\n') if isinstance(out, tuple) and type(out[0]).__name__ == 'function':