diff --git a/avocado/utils/genio.py b/avocado/utils/genio.py index 557e972f1ecfa6dbe5fb2d7a404d27a1b75327f9..298fe461eed176f099d95e3ef183e61a29ad9b23 100644 --- a/avocado/utils/genio.py +++ b/avocado/utils/genio.py @@ -20,6 +20,8 @@ import logging import os import time +from six.moves import input + from . import path as utils_path log = logging.getLogger('avocado.test') @@ -99,7 +101,7 @@ def ask(question, auto=False): if auto: log.info("%s (y/n) y" % question) return "y" - return raw_input("%s (y/n) " % question) + return input("%s (y/n) " % question) def read_file(filename): diff --git a/examples/tests/failtest_ugly.py b/examples/tests/failtest_ugly.py index 048a735d06e36b877ef28fb766337ea9d86667e5..4cfb6026148e9be5849b1c093fd564ebf2b91200 100644 --- a/examples/tests/failtest_ugly.py +++ b/examples/tests/failtest_ugly.py @@ -6,7 +6,7 @@ import sys sys.stdout.write("Direct output to stdout\n") sys.stderr.write("Direct output to stderr\n") -raw_input("I really want some input on each import") +input("I really want some input on each import") sys.stdin = 'This is my __COOL__ stdin' sys.stdout = 'my stdout' sys.stderr = 'my stderr' diff --git a/scripts/avocado-run-testplan b/scripts/avocado-run-testplan index 301c7e4c2bd2b80f1417d5fbf7717c7c8b730cb5..f252f9b18e3c35faeaf9bfd3dda7e6a2ec3034b0 100755 --- a/scripts/avocado-run-testplan +++ b/scripts/avocado-run-testplan @@ -23,6 +23,8 @@ import sys import argparse +from six.moves import input + class Parser(argparse.ArgumentParser): @@ -89,9 +91,9 @@ class App(object): result = None while True: - result = raw_input("Result ([P]ass, [F]ail, [S]kip): ") + result = input("Result ([P]ass, [F]ail, [S]kip): ") if result in RESULT_MAP.keys(): - notes = raw_input("Additional Notes: ") + notes = input("Additional Notes: ") break print("") @@ -99,7 +101,7 @@ class App(object): "result": RESULT_MAP.get(result), "notes": notes.strip()}) - user = raw_input("Your identification [%s]: " % getpass.getuser()) + user = input("Your identification [%s]: " % getpass.getuser()) if not user: user = getpass.getuser() self.user_identification = user