Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2013 19:53:20 +0000 (UTC)
From:      Hiren Panchasara <hiren@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r250612 - head/tools/test/hwpmc
Message-ID:  <201305131953.r4DJrKSx062788@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hiren
Date: Mon May 13 19:53:19 2013
New Revision: 250612
URL: http://svnweb.freebsd.org/changeset/base/250612

Log:
  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)

Modified:
  head/tools/test/hwpmc/pmctest.py

Modified: head/tools/test/hwpmc/pmctest.py
==============================================================================
--- head/tools/test/hwpmc/pmctest.py	Mon May 13 19:52:35 2013	(r250611)
+++ head/tools/test/hwpmc/pmctest.py	Mon May 13 19:53:19 2013	(r250612)
@@ -51,6 +51,10 @@ import sys
 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()
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305131953.r4DJrKSx062788>