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
This commit is contained in:
hazelnutsgz 2018-08-29 09:29:07 +08:00
parent c3d9e4e689
commit 482d1acea8
2 changed files with 7 additions and 7 deletions

View File

@ -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 <groups.xml> --pkgdir <pkgdir>" \
% os.path.basename(sys.argv[0])
print("Usage: %s --groups <groups.xml> --pkgdir <pkgdir>" \
% os.path.basename(sys.argv[0]))
exit(1)
def add_text_tag_to_xml(parent,

View File

@ -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))