Migration Python2 towards Python3 (#4232)
The modified code stays compatible with Python2.
This commit is contained in:
@@ -87,9 +87,9 @@ for file in filenames:
|
||||
try:
|
||||
doc = xml.dom.minidom.parse(file)
|
||||
except Exception as ex:
|
||||
print "============================================"
|
||||
print "/!\\ Expat doesn't like ", file, "! Error=", type(ex), " (", ex.args, ")"
|
||||
print "============================================"
|
||||
print("============================================")
|
||||
print("/!\\ Expat doesn't like ", file, "! Error=", type(ex), " (", ex.args, ")")
|
||||
print("============================================")
|
||||
|
||||
traverse(file, doc, isChallenge, isGP, isKart, isTrack, isAchievements)
|
||||
|
||||
|
||||
@@ -25,14 +25,14 @@ import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print "Usage: getpo_authors.py PATH_TO_PO_FILE"
|
||||
print("Usage: getpo_authors.py PATH_TO_PO_FILE")
|
||||
sys.exit(-1)
|
||||
|
||||
for filename in sys.argv[1:]:
|
||||
print("Processing file %s" % filename)
|
||||
f = open(filename, "r")
|
||||
if not f:
|
||||
print "Can not find", filename
|
||||
print("Can not find", filename)
|
||||
exit
|
||||
lines = f.readlines()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user