From 05864d89d10c54fe35fe510833c55e41b47170a0 Mon Sep 17 00:00:00 2001 From: Hiren Panchasara Date: Mon, 13 May 2013 19:53:19 +0000 Subject: [PATCH] As python3 does not have raw_input(), convert it to input() when we are using python3. PR: 177214 Reviewed by: gnn Approved by: sbruno (mentor) --- tools/test/hwpmc/pmctest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/test/hwpmc/pmctest.py b/tools/test/hwpmc/pmctest.py index fb4a97719466..9265dde61a2d 100755 --- a/tools/test/hwpmc/pmctest.py +++ b/tools/test/hwpmc/pmctest.py @@ -51,6 +51,10 @@ import subprocess from subprocess import PIPE +# Use input() for Python version 3 +if sys.version_info[0] == 3: + raw_input = input + # A list of strings that are not really counters, just # name tags that are output by pmccontrol -L notcounter = ["IAF", "IAP", "TSC", "UNC", "UCF", "UCP", "SOFT" ] @@ -87,7 +91,7 @@ def main(): print(result) if (options.wait == True): try: - value = input("next?") + value = raw_input("next?") except EOFError: sys.exit()