Spaceinvaders asks me to press Ctrl+C, but doesn't catch KeyboardInterupt
Closed this issue · 2 comments
moggers87 commented
Not really a bug per se, but it looks ugly.
Steps to reproduce:
- Run game in terminal that's too small
- Observe instruction to either resize terminal or press "Ctrl + C"
- Press "Ctrl + C"
Expected results:
Game exits gracefully
Actual results
$ spacedinvaders
Traceback (most recent call last):
File "/home/moggers/workspace/spacedinvaders/spacedinvaders/__init__.py", line 471, in resize_arena
stdscr.mvwin(y_pad, x_pad)
_curses.error: mvwin() returned ERR
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/moggers/workspace/spacedinvaders/env/bin/spacedinvaders", line 33, in <module>
sys.exit(load_entry_point('spacedinvaders', 'console_scripts', 'spacedinvaders')())
File "/home/moggers/workspace/spacedinvaders/spacedinvaders/__init__.py", line 1483, in main
curses.wrapper(partial(mainloop, use_sound=opts.use_sound))
File "/usr/lib64/python3.9/curses/__init__.py", line 94, in wrapper
return func(stdscr, *args, **kwds)
File "/home/moggers/workspace/spacedinvaders/spacedinvaders/__init__.py", line 1431, in mainloop
resize_arena(stdscr)
File "/home/moggers/workspace/spacedinvaders/spacedinvaders/__init__.py", line 489, in resize_arena
while stdscr.getch() != curses.KEY_RESIZE:
KeyboardInterrupt
yawpitch commented
Ahh, good catch, will get that fixed in the next commit.