diff options
author | Klement Sekera <ksekera@cisco.com> | 2018-03-21 12:35:51 +0100 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-03-23 12:57:41 +0000 |
commit | 13a83ef4d4d05211601b023fa667b5332850fccc (patch) | |
tree | 786a1c6743444e30609b2d6da86e121f97d69b4c /test/hook.py | |
parent | 3f2dd30b0bf7cf3d82c720d5065178c1fa628c6b (diff) |
make test: code cleanup
Change-Id: Ic689de569e5b6e6209d16d6acdb13c489daca1f5
Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/hook.py')
-rw-r--r-- | test/hook.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/hook.py b/test/hook.py index 44b432e5c25..49b41c91dff 100644 --- a/test/hook.py +++ b/test/hook.py @@ -1,5 +1,6 @@ import signal import os +import sys import traceback from log import RED, single_line_delim, double_line_delim from debug import spawn_gdb @@ -167,14 +168,15 @@ class StepHook(PollHook): print("Calls in/below that stack frame will be not be stepped anymore") print(single_line_delim) while True: - choice = raw_input("Enter your choice, if any, and press ENTER to " - "continue running the testcase...") + choice = sys.stdin.readline( + "Enter your choice, if any, and press ENTER to continue " + "running the testcase...") if choice == "": choice = None try: if choice is not None: num = int(choice) - except: + except TypeError: print("Invalid input") continue if choice is not None and (num < 0 or num >= len(stack)): |