Permalink
Browse files

Catch unicode errors that come from lib2to3

  • Loading branch information...
1 parent 5ccdb7d commit d1aaff89163c1d80e85a5f242915dfb3d77fdd94 myint committed Sep 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 autopep8.py
View
@@ -760,7 +760,7 @@ def refactor(self, fixer_name, ignore=None):
try:
new_text = refactor_with_2to3(''.join(self.source),
fixer_name=fixer_name)
- except pgen2.parse.ParseError:
+ except (pgen2.parse.ParseError, UnicodeDecodeError, UnicodeEncodeError):
return []
if ''.join(self.source).strip() == new_text.strip():

0 comments on commit d1aaff8

Please sign in to comment.