summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Stefani <luca.stefani.ge1@gmail.com>2020-02-09 13:28:26 +0100
committerLuca Stefani <luca.stefani.ge1@gmail.com>2020-02-09 13:28:26 +0100
commit67e7d247a468bc46b1a18edb909a1bfa0cf5f830 (patch)
tree00750c90962b670ccafd883daf23c003f95f1850
parent610ca1db29493fdcd3789d8093a6bc96f3bf000b (diff)
downloadktlint-67e7d247a468bc46b1a18edb909a1bfa0cf5f830.tar.gz
Add support for python3
Change-Id: I4b9869ff2603d7f2aea39572d47a46fbae394bee
-rwxr-xr-xktlint.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/ktlint.py b/ktlint.py
index de256cd..72adbab 100755
--- a/ktlint.py
+++ b/ktlint.py
@@ -18,6 +18,8 @@
"""Script that is used by developers to run style checks on Kotlin files."""
+from __future__ import print_function
+
import argparse
import errno
import os
@@ -57,15 +59,15 @@ def main(args=None):
stdout=subprocess.PIPE, env=ktlint_env)
stdout, _ = check.communicate()
if stdout:
- print 'prebuilts/ktlint found errors in files you changed:'
- print stdout
- print FORMAT_MESSAGE.format(MAIN_DIRECTORY, ' '.join(kt_files))
+ print('prebuilts/ktlint found errors in files you changed:')
+ print(stdout)
+ print(FORMAT_MESSAGE.format(MAIN_DIRECTORY, ' '.join(kt_files)))
sys.exit(1)
else:
sys.exit(0)
except OSError as e:
if e.errno == errno.ENOENT:
- print 'Error running ktlint!'
+ print('Error running ktlint!')
sys.exit(1)
if __name__ == '__main__':