summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Mike Naberezny <mike@naberezny.com>2015-03-06 13:44:48 -0800
committer Mike Naberezny <mike@naberezny.com>2015-03-06 13:44:48 -0800
commit877b3bb9bbc3638a6df6567ee97898704abfb657 (patch)
treefe1f563afea01461468f0a245cc4e4c572b5c283
parentec2e1b97560281c1a2471921faecab2bf96c87c5 (diff)
jedtest.py: Python 3 compat. (nw)
-rw-r--r--src/regtests/jedutil/jedtest.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/regtests/jedutil/jedtest.py b/src/regtests/jedutil/jedtest.py
index bbb63ddee4f..10ec60d1023 100644
--- a/src/regtests/jedutil/jedtest.py
+++ b/src/regtests/jedutil/jedtest.py
@@ -58,14 +58,14 @@ def runViewJedTests(tests, jedUtilApp):
for test in tests:
command = [jedUtilApp, "-view", test.jedFile, test.name]
if VERBOSE:
- print "Viewing the JED file: %s" % test.jedFile
- print "Command: %s" % " ".join(command)
+ print("Viewing the JED file: %s" % test.jedFile)
+ print("Command: %s" % " ".join(command))
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdout,stderr) = process.communicate()
if stderr:
- print "Error: JED test named " + test.name + " failed during viewing (" + stderr.strip() + ")."
+ print("Error: JED test named " + test.name + " failed during viewing (" + stderr.decode('latin-1').strip() + ").")
fp = open(test.outputFile, "wb")
fp.write(stdout)
@@ -85,11 +85,11 @@ def main():
jedUtilApp = os.path.normpath(os.path.join(currentDirectory, "..", "..", "..", "jedutil"))
if VERBOSE:
- print "JED Path: %s" % jedsPath
- print "Baseline Path: %s" % baselinePath
- print "Output Path: %s" % outputPath
- print "jedutil App: %s" % jedUtilApp
- print
+ print("JED Path: %s" % jedsPath)
+ print("Baseline Path: %s" % baselinePath)
+ print("Output Path: %s" % outputPath)
+ print("jedutil App: %s" % jedUtilApp)
+ print('')
# Insure everything exists
@@ -97,21 +97,21 @@ def main():
not os.path.exists(jedsPath) or
not os.path.exists(baselinePath) or
not os.path.exists(jedUtilApp)):
- print "One of the above paths does not exist. Aborting. %s" % jedUtilApp
+ print("One of the above paths does not exist. Aborting. %s" % jedUtilApp)
return 3
# Gather the tests
tests = findJedTests(jedsPath, baselinePath, outputPath)
if not len(tests):
- print "No tests found!"
+ print("No tests found!")
return 2
# Setup the output paths
if VERBOSE:
- print "Cleaning the output directory"
- print
+ print("Cleaning the output directory")
+ print('')
if os.path.exists(outputPath):
shutil.rmtree(outputPath)
os.makedirs(outputPath)
@@ -129,15 +129,15 @@ def main():
success = True
for test in tests:
if VERBOSE:
- print "Diffing the output from viewing the JED file: %s" % os.path.basename(test.jedFile)
+ print("Diffing the output from viewing the JED file: %s" % os.path.basename(test.jedFile))
if not filecmp.cmp(test.outputFile, test.baselineFile):
success = False
- print "Test %s failed" % os.path.basename(test.jedFile)
+ print("Test %s failed" % os.path.basename(test.jedFile))
# Report
if success:
- print "All tests ran successfully."
+ print("All tests ran successfully.")
return 0