diff options
author | Luca Stefani <luca.stefani.ge1@gmail.com> | 2020-02-09 13:28:26 +0100 |
---|---|---|
committer | Luca Stefani <luca.stefani.ge1@gmail.com> | 2020-02-09 13:28:26 +0100 |
commit | 67e7d247a468bc46b1a18edb909a1bfa0cf5f830 (patch) | |
tree | 00750c90962b670ccafd883daf23c003f95f1850 | |
parent | 610ca1db29493fdcd3789d8093a6bc96f3bf000b (diff) | |
download | ktlint-67e7d247a468bc46b1a18edb909a1bfa0cf5f830.tar.gz |
Add support for python3
Change-Id: I4b9869ff2603d7f2aea39572d47a46fbae394bee
-rwxr-xr-x | ktlint.py | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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__': |