summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lint
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/lint')
-rw-r--r--llvm/utils/lint/common_lint.py3
-rwxr-xr-xllvm/utils/lint/cpp_lint.py3
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/utils/lint/common_lint.py b/llvm/utils/lint/common_lint.py
index e982680c052..aec907929b4 100644
--- a/llvm/utils/lint/common_lint.py
+++ b/llvm/utils/lint/common_lint.py
@@ -2,6 +2,7 @@
#
# Common lint functions applicable to multiple types of files.
+from __future__ import print_function
import re
def VerifyLineLength(filename, lines, max_length):
@@ -89,7 +90,7 @@ def RunLintOverAllFiles(linter, filenames):
for filename in filenames:
file = open(filename, 'r')
if not file:
- print 'Cound not open %s' % filename
+ print('Cound not open %s' % filename)
continue
lines = file.readlines()
lint.extend(linter.RunOnFile(filename, lines))
diff --git a/llvm/utils/lint/cpp_lint.py b/llvm/utils/lint/cpp_lint.py
index 07fad5840fd..2fb8cc93c19 100755
--- a/llvm/utils/lint/cpp_lint.py
+++ b/llvm/utils/lint/cpp_lint.py
@@ -6,6 +6,7 @@
# TODO: add unittests for the verifier functions:
# http://docs.python.org/library/unittest.html .
+from __future__ import print_function
import common_lint
import re
import sys
@@ -86,7 +87,7 @@ class CppLint(common_lint.BaseLint):
def CppLintMain(filenames):
all_lint = common_lint.RunLintOverAllFiles(CppLint(), filenames)
for lint in all_lint:
- print '%s:%d:%s' % (lint[0], lint[1], lint[2])
+ print('%s:%d:%s' % (lint[0], lint[1], lint[2]))
return 0
OpenPOWER on IntegriCloud