pre-commit-hooks: python3.6+
diff --git a/pre_commit_hooks/check_toml.py b/pre_commit_hooks/check_toml.py
index e16e17c..51a1f15 100644
--- a/pre_commit_hooks/check_toml.py
+++ b/pre_commit_hooks/check_toml.py
@@ -1,14 +1,11 @@
-from __future__ import print_function
-
import argparse
-import sys
from typing import Optional
from typing import Sequence
import toml
-def main(argv=None): # type: (Optional[Sequence[str]]) -> int
+def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='Filenames to check.')
args = parser.parse_args(argv)
@@ -19,10 +16,10 @@
with open(filename) as f:
toml.load(f)
except toml.TomlDecodeError as exc:
- print('{}: {}'.format(filename, exc))
+ print(f'{filename}: {exc}')
retval = 1
return retval
if __name__ == '__main__':
- sys.exit(main())
+ exit(main())