diff options
Diffstat (limited to 'ngxtop/utils.py')
-rw-r--r-- | ngxtop/utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ngxtop/utils.py b/ngxtop/utils.py index ef61072..7bd9a2a 100644 --- a/ngxtop/utils.py +++ b/ngxtop/utils.py @@ -5,6 +5,8 @@ def choose_one(choices, prompt): for idx, choice in enumerate(choices): print('%d. %s' % (idx + 1, choice)) selected = None + if sys.version[0] == '3': + raw_input = input while not selected or selected <= 0 or selected > len(choices): selected = raw_input(prompt) try: @@ -16,4 +18,4 @@ def choose_one(choices, prompt): def error_exit(msg, status=1): sys.stderr.write('Error: %s\n' % msg) - sys.exit(status)
\ No newline at end of file + sys.exit(status) |