From 63467e47a60fc5f8bfe4af21ad13c82bb5f4cd63 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 24 Apr 2019 11:02:43 -0400 Subject: [PATCH] Prevent hang on ill-formed torpedo command. --- sst.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.31.1