From ef0d69a5069eef56d4601deb0848059b7271b907 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Tue, 26 Jul 2016 00:34:50 +0300 Subject: [PATCH] Use print function for Python 3 compatibility --- scripts/print_subtree.py | 5 +++-- tests/run_all.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/print_subtree.py b/scripts/print_subtree.py index da5eae8..d6c3f74 100755 --- a/scripts/print_subtree.py +++ b/scripts/print_subtree.py @@ -1,4 +1,5 @@ #! /usr/bin/env python +from __future__ import print_function import sys from sqlparse import parse @@ -13,12 +14,12 @@ def test(): "/*! directive*/ INSERT INTO `MyTable` (`Id`, `Name`) " "VALUES (1, 'one')" ): - print "----------" + print("----------") for parsed in parse(query): requote_names(parsed) print_tokens(parsed) print_subtree(parsed) - print "----------" + print("----------") def main(query): diff --git a/tests/run_all.py b/tests/run_all.py index 2e217bf..9503411 100755 --- a/tests/run_all.py +++ b/tests/run_all.py @@ -1,4 +1,5 @@ #! /usr/bin/env python +from __future__ import print_function import os @@ -31,7 +32,7 @@ def main(): os.environ["PYTHONPATH"] = os.curdir for test in sorted(tests): - print test + print(test) subprocess.call((sys.executable, '-m', test)) if __name__ == '__main__': -- 2.39.2