From 328cfa015ee53eca56bf3c9145ff1461a12093fa Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 25 Feb 2017 05:33:55 -0500 Subject: [PATCH] Polyglotize. --- sst.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sst.py b/sst.py index 5885774..2cc711b 100755 --- a/sst.py +++ b/sst.py @@ -21,6 +21,13 @@ try: except ImportError: pass +# Prevent lossage under Python 3 +try: + my_input = raw_input +except NameError: + my_input = input + + version = "2.1" docpath = (".", "doc/", "/usr/share/doc/sst/") @@ -3404,7 +3411,7 @@ def pause_game(): sys.stdout.write('\n') proutn(prompt) if not replayfp: - input() + my_input() sys.stdout.write('\n' * rows) linecount = 0 @@ -3476,7 +3483,7 @@ def cgetline(): elif linein[0] != "#": break else: - linein = eval(input()) + "\n" + linein = my_input() + "\n" if logfp: logfp.write(linein) return linein -- 2.31.1