From: Oleg Broytman Date: Mon, 25 Jul 2016 21:34:50 +0000 (+0300) Subject: Use print function for Python 3 compatibility X-Git-Tag: 0.0.1~55 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=ef0d69a5069eef56d4601deb0848059b7271b907;p=sqlconvert.git Use print function for Python 3 compatibility --- 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__':