From 482d1acea86ca7c424507268b71e1a9e20729aef Mon Sep 17 00:00:00 2001 From: hazelnutsgz <15201752137@163.com> Date: Wed, 29 Aug 2018 09:29:07 +0800 Subject: [PATCH] Fix the print syntax inconsistency between python2 and python3 Using the automation tool & manual check to fix the print syntax. Task: 24595 Story: 2003426 Change-Id: I3844c9644aabeeeb27bc2abb106c839b9921fe78 --- bsp-files/platform_comps.py | 6 +++--- .../cgts-mtce-common-1.0/hwmon/scripts/hwmond_notify.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bsp-files/platform_comps.py b/bsp-files/platform_comps.py index 54e345b8..f0797d3e 100644 --- a/bsp-files/platform_comps.py +++ b/bsp-files/platform_comps.py @@ -6,7 +6,7 @@ Copyright (c) 2018 Wind River Systems, Inc. SPDX-License-Identifier: Apache-2.0 """ - +from __future__ import print_function import getopt import os import platform @@ -15,8 +15,8 @@ import sys import xml.etree.ElementTree as ElementTree def usage(): - print "Usage: %s --groups --pkgdir " \ - % os.path.basename(sys.argv[0]) + print("Usage: %s --groups --pkgdir " \ + % os.path.basename(sys.argv[0])) exit(1) def add_text_tag_to_xml(parent, diff --git a/mtce-common/cgts-mtce-common-1.0/hwmon/scripts/hwmond_notify.py b/mtce-common/cgts-mtce-common-1.0/hwmon/scripts/hwmond_notify.py index 840f6cb3..69408032 100644 --- a/mtce-common/cgts-mtce-common-1.0/hwmon/scripts/hwmond_notify.py +++ b/mtce-common/cgts-mtce-common-1.0/hwmon/scripts/hwmond_notify.py @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: Apache-2.0 # - +from __future__ import print_function import socket import os @@ -11,9 +11,9 @@ UDP_IP = socket.gethostbyname('controller') UDP_PORT = 2188 ENV_MESSAGE = os.environ["MESSAGE"] -print "UDP target IP:", UDP_IP -print "UDP target port:", UDP_PORT -print "message:", ENV_MESSAGE +print ("UDP target IP:", UDP_IP) +print ("UDP target port:", UDP_PORT) +print ("message:", ENV_MESSAGE) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.sendto(ENV_MESSAGE, (UDP_IP, UDP_PORT))