From 884d3613afb0f04b454cb0fed16979e1b478d727 Mon Sep 17 00:00:00 2001 From: "sonu.kumar" Date: Mon, 20 Jul 2015 18:05:09 +0530 Subject: [PATCH] Replaced print with print() to provide py 2/3 compatibility Replaced print statement of python 2 to print() of python 3 to provide py 2/3 compatibility. Change-Id: I4d0501d37051607c2c7b44fe71374421765a922b --- tools/pretty_flake8.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/pretty_flake8.py b/tools/pretty_flake8.py index f08c16847..2989f4fe4 100755 --- a/tools/pretty_flake8.py +++ b/tools/pretty_flake8.py @@ -11,6 +11,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +from __future__ import print_function import re import sys @@ -37,9 +38,9 @@ def main(): if len(m['file']) > max_filename_len: max_filename_len = len(m['file']) else: - print line + print(line) - print 'Flake8 Results' + print('Flake8 Results') ct = PrettyTable([ "File", @@ -57,7 +58,7 @@ def main(): for line in raw_errors: ct.add_row(format_dict(line)) - print ct + print(ct) with open('flake8_results.html', 'w') as f: f.write('%s' % ct.get_html_string(attributes = {"cellspacing": 0})) # noqa