Skip to content

Commit

Permalink
fix: fix TypeError when running test.pebble_cli (canonical#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 and tonyandrewmeyer committed Jun 26, 2024
1 parent 36a8a60 commit 98fc2f3
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 98fc2f3

Please # to comment.