From 98fc2f3cfb0d45cb4546786db3cf68ebba20fef9 Mon Sep 17 00:00:00 2001 From: Ben Hoyt Date: Wed, 5 Jun 2024 16:40:41 +1200 Subject: [PATCH] fix: fix TypeError when running test.pebble_cli (#1245) Without this fix, running this raises the following: ``` TypeError: catching classes that do not inherit from BaseException is not allowed ``` Not sure how to silence pyright without the type: ignores. I guess we haven't used this script in a while. :-) --- test/pebble_cli.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/pebble_cli.py b/test/pebble_cli.py index 5ae722df0..0e7a2078d 100644 --- a/test/pebble_cli.py +++ b/test/pebble_cli.py @@ -246,9 +246,8 @@ def main(): if stderr: print(repr(stderr), end='', file=sys.stderr) sys.exit(0) - # The `[str]` here is to resolve the same issue as above. - except pebble.ExecError[str] as e: - print('ExecError:', e, file=sys.stderr) + except pebble.ExecError as e: # type: ignore + print('ExecError:', e, file=sys.stderr) # type: ignore sys.exit(e.exit_code) elif args.command == 'ls':