Skip to content

Commit

Permalink
Catch unicode errors that come from lib2to3
Browse files Browse the repository at this point in the history
  • Loading branch information
myint committed Sep 15, 2012
1 parent 5ccdb7d commit d1aaff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autopep8.py
Expand Up @@ -760,7 +760,7 @@ def refactor(self, fixer_name, ignore=None):
try: try:
new_text = refactor_with_2to3(''.join(self.source), new_text = refactor_with_2to3(''.join(self.source),
fixer_name=fixer_name) fixer_name=fixer_name)
except pgen2.parse.ParseError: except (pgen2.parse.ParseError, UnicodeDecodeError, UnicodeEncodeError):
return [] return []


if ''.join(self.source).strip() == new_text.strip(): if ''.join(self.source).strip() == new_text.strip():
Expand Down

0 comments on commit d1aaff8

Please sign in to comment.