Skip to content

Commit

Permalink
fix: fix TypeError when running test.pebble_cli (#1245)
Browse files Browse the repository at this point in the history
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. :-)
  • Loading branch information
benhoyt authored Jun 5, 2024
1 parent e0d5a05 commit dcbe21b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/pebble_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit dcbe21b

Please # to comment.