Merge pull request #32 from ChristophGra/master

Error handling when getch() throws an error
pull/34/head
Jake Funke 2020-09-15 12:15:58 -07:00 committed by GitHub
commit f243391418
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -756,9 +756,11 @@ class CursedMenu(object):
self.screen.addstr(16, 2, "{}'s garden is locked, but you can see in...".format(guest_garden)) self.screen.addstr(16, 2, "{}'s garden is locked, but you can see in...".format(guest_garden))
else: else:
self.screen.addstr(16, 2, "i can't seem to find directions to {}...".format(guest_garden)) self.screen.addstr(16, 2, "i can't seem to find directions to {}...".format(guest_garden))
try:
self.screen.getch() self.screen.getch()
self.clear_info_pane() self.clear_info_pane()
self.draw_plant_ascii(self.plant) self.draw_plant_ascii(self.plant)
finally:
self.visited_plant = None self.visited_plant = None
def water_on_visit(self, guest_visitor_file): def water_on_visit(self, guest_visitor_file):