summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/lib2to3/main.py')
-rw-r--r--Lib/lib2to3/main.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/lib2to3/main.py b/Lib/lib2to3/main.py
index 736d5a6..caf54dd 100644
--- a/Lib/lib2to3/main.py
+++ b/Lib/lib2to3/main.py
@@ -60,8 +60,14 @@ class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool):
else:
self.log_message("Refactored %s", filename)
if self.show_diffs:
- for line in diff_texts(old, new, filename):
- print line
+ diff_lines = diff_texts(old, new, filename)
+ try:
+ for line in diff_lines:
+ print line
+ except UnicodeEncodeError:
+ warn("couldn't encode %s's diff for your terminal" %
+ (filename,))
+ return
def warn(msg):