diff options
author | Brian May <brian@linuxpenguins.xyz> | 2018-07-15 09:37:12 +1000 |
---|---|---|
committer | Brian May <brian@linuxpenguins.xyz> | 2018-08-06 16:57:35 +1000 |
commit | dbfa93c62253aab8e1ceb1c1ed578ae88c9dc8f7 (patch) | |
tree | 5eafb3a2eed75924c515b4bf0250d83d9fb67400 /lib/python/sectracker_test | |
parent | 4b9d6d320f02267e1d5c2d6c21c69314197adc8e (diff) |
Fix print statements for Python 3.6 compatibility
Diffstat (limited to 'lib/python/sectracker_test')
-rw-r--r-- | lib/python/sectracker_test/run.py | 9 | ||||
-rw-r--r-- | lib/python/sectracker_test/test_analyzers.py | 7 | ||||
-rw-r--r-- | lib/python/sectracker_test/test_parsers.py | 8 |
3 files changed, 13 insertions, 11 deletions
diff --git a/lib/python/sectracker_test/run.py b/lib/python/sectracker_test/run.py index 886eded6a8..44fa675fcb 100644 --- a/lib/python/sectracker_test/run.py +++ b/lib/python/sectracker_test/run.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +from __future__ import print_function if __name__ != "__main__": raise Exception("run must be executed directly") @@ -45,13 +46,13 @@ for name in files: if name[-3:] != ".py" or name == "run.py": continue fullpath = "%s/%s" % (ourpath, name) - print "* Running", name + print("* Running", name) p = subprocess.Popen(("python", "--", fullpath), env=env) ret = p.wait() if ret != 0: - print "Test exited with status", ret - print + print("Test exited with status", ret) + print() errors = errors or ret != 0 if errors: - print "ERROR: some tests aborted with errors" + print("ERROR: some tests aborted with errors") sys.exit(1) diff --git a/lib/python/sectracker_test/test_analyzers.py b/lib/python/sectracker_test/test_analyzers.py index 133c9386dd..e192945e2b 100644 --- a/lib/python/sectracker_test/test_analyzers.py +++ b/lib/python/sectracker_test/test_analyzers.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +from __future__ import print_function import os @@ -43,7 +44,7 @@ if False: for r, pv in rpv.items(): for p, v in pv.items(): if len(v) > 1: - print r, p, v + print(r, p, v) # copysources copysrc = copysources(bugdb, diag) @@ -54,12 +55,12 @@ assert "DSA-1472-1" in copysrc["CVE-2008-0225"] vdb = fixedversions(bugdb, copysrc, rpv, diag) if False: for v in vdb: - print v + print(v) assert bestversion(c, "sid", "bash").name == "bash" assert bestversion(c, "sid", "bash", ("unsupported", "supported")).name \ == "bash" for err in diag.messages(): - print "%s:%d: %s: %s" % (err.file, err.line, err.level, err.message) + print("%s:%d: %s: %s" % (err.file, err.line, err.level, err.message)) assert not diag.messages() diff --git a/lib/python/sectracker_test/test_parsers.py b/lib/python/sectracker_test/test_parsers.py index 436b2f027c..970e9f4177 100644 --- a/lib/python/sectracker_test/test_parsers.py +++ b/lib/python/sectracker_test/test_parsers.py @@ -28,22 +28,22 @@ assert "bash" in o["bash"].binary safeunlink("../../data/CVE/list" + EXTENSION) o = cvelist("../../data/CVE/list") for err in o.messages: - print "%s:%d: %s: %s" % (err.file, err.line, err.level, err.message) + print("%s:%d: %s: %s" % (err.file, err.line, err.level, err.message)) safeunlink("../../data/DSA/list" + EXTENSION) o = dsalist("../../data/DSA/list") for err in o.messages: - print "%s:%d: %s: %s" % (err.file, err.line, err.level, err.message) + print("%s:%d: %s: %s" % (err.file, err.line, err.level, err.message)) safeunlink("../../data/DTSA/list" + EXTENSION) o = dtsalist("../../data/DTSA/list") for err in o.messages: - print "%s:%d: %s: %s" % (err.file, err.line, err.level, err.message) + print("%s:%d: %s: %s" % (err.file, err.line, err.level, err.message)) safeunlink("../../data/DLA/list" + EXTENSION) o = dlalist("../../data/DLA/list") for err in o.messages: - print "%s:%d: %s: %s" % (err.file, err.line, err.level, err.message) + print("%s:%d: %s: %s" % (err.file, err.line, err.level, err.message)) Message = sectracker.diagnostics.Message for (line, res, xmsgs) in [ |