]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools/xenmon: make xenmon.py compatible with python 2 and 3
authorWei Liu <wei.liu2@citrix.com>
Mon, 1 Apr 2019 10:39:00 +0000 (11:39 +0100)
committerWei Liu <wei.liu2@citrix.com>
Mon, 1 Apr 2019 12:22:31 +0000 (13:22 +0100)
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
tools/xenmon/xenmon.py

index 2a948cd48abd405350eb9945c08be27407b9d04a..175eacd2cb1dd8c7add2e5984809a0b79dc10a8f 100644 (file)
@@ -23,6 +23,8 @@
 #   along with this program; If not, see <http://www.gnu.org/licenses/>.
 #####################################################################
 
+from __future__ import print_function
+
 import mmap
 import struct
 import os
@@ -248,8 +250,8 @@ def display(scr, row, col, str, attr=0):
         scr.keypad(0)
         _c.echo()
         _c.endwin()
-        print "Your terminal screen is not big enough; Please resize it."
-        print "row=%d, col=%d, str='%s'" % (row, col, str)
+        print("Your terminal screen is not big enough; Please resize it.")
+        print("row=%d, col=%d, str='%s'" % (row, col, str))
         sys.exit(1)
 
 
@@ -704,7 +706,7 @@ def main():
         try:
             writelog()
         except:
-            print 'Quitting.'
+            print('Quitting.')
     stop_xenbaked()
 
 if __name__ == "__main__":