From patchwork Mon Apr 1 10:39:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10879683 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 02C011708 for ; Mon, 1 Apr 2019 10:41:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E142A286A2 for ; Mon, 1 Apr 2019 10:40:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFB5F287D4; Mon, 1 Apr 2019 10:40:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7D527286A2 for ; Mon, 1 Apr 2019 10:40:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hAuLP-0000rZ-5S; Mon, 01 Apr 2019 10:39:11 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1hAuLN-0000rT-4z for xen-devel@lists.xenproject.org; Mon, 01 Apr 2019 10:39:09 +0000 X-Inumbo-ID: 6082d0d4-546a-11e9-bc90-bc764e045a96 Received: from SMTP03.CITRIX.COM (unknown [162.221.156.55]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 6082d0d4-546a-11e9-bc90-bc764e045a96; Mon, 01 Apr 2019 10:39:07 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.60,296,1549929600"; d="scan'208";a="82364125" From: Wei Liu To: Date: Mon, 1 Apr 2019 11:39:00 +0100 Message-ID: <20190401103900.17269-1-wei.liu2@citrix.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/xenmon: make xenmon.py compatible with python 2 and 3 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Wei Liu Acked-by: Andrew Cooper --- tools/xenmon/xenmon.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/xenmon/xenmon.py b/tools/xenmon/xenmon.py index 2a948cd48a..175eacd2cb 100644 --- a/tools/xenmon/xenmon.py +++ b/tools/xenmon/xenmon.py @@ -23,6 +23,8 @@ # along with this program; If not, see . ##################################################################### +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__":