From: Eric S. Raymond Date: Wed, 24 Apr 2019 15:02:43 +0000 (-0400) Subject: Prevent hang on ill-formed torpedo command. X-Git-Tag: 2.5~14 X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=commitdiff_plain;h=63467e47a60fc5f8bfe4af21ad13c82bb5f4cd63;hp=24313a55dd418775c3b22a13389b23324ad0ccb7 Prevent hang on ill-formed torpedo command. --- diff --git a/sst.py b/sst.py index 07317a0..12f1bad 100755 --- a/sst.py +++ b/sst.py @@ -1738,7 +1738,11 @@ def torps(): proutn(_("Number of torpedoes to fire- ")) continue # Go back around to get a number else: # key == "IHREAL" - n = scanner.int() + try: + n = scanner.int() + except TypeError: + huh() + return if n <= 0: # abort command scanner.chew() return