This commit is contained in:
Sviatoslav Sydorenko 2017-06-08 08:44:22 +00:00 committed by GitHub
commit f8de2e4621
6 changed files with 9 additions and 14 deletions

View file

@ -2,7 +2,6 @@ from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import io
import sys
import autopep8
@ -14,12 +13,12 @@ def main(argv=None):
retv = 0
for filename in args.files:
original_contents = io.open(filename).read()
original_contents = open(filename).read()
new_contents = autopep8.fix_code(original_contents, args)
if original_contents != new_contents:
print('Fixing {}'.format(filename))
retv = 1
with io.open(filename, 'w') as output_file:
with open(filename, 'w') as output_file:
output_file.write(new_contents)
return retv