Piping invalid data (anything that doesn't exit properly) to botany caused an infinite loop, since getch immediately returns -1 when the input is closed. This PR fixes the issue by raising an IOError exception when getch returns -1, which is then caught in the main loop and exits the program.
I'd rather disallow piping of characters into botany at all if possible. It's not in the spirit of the game. (But this commit does look like it would fix the issue at hand)
Piping invalid data (anything that doesn't exit properly) to botany caused an infinite loop, since
getch
immediately returns-1
when the input is closed. This PR fixes the issue by raising anIOError
exception whengetch
returns-1
, which is then caught in the main loop and exits the program.