1. Joe Amenta
  2. lib3to2

Commits

Steven Silvester  committed dfc8d2d

Better handling of unicode printing

  • Participants
  • Parent commits 3ee590f
  • Branches default

Comments (0)

Files changed (1)

File lib3to2/main.py

View file
+# -*- coding: utf-8 -*-
 """
 Main program for 3to2.
 """
-
+from __future__ import print_function
 import sys
 import os
 import difflib
             self.log_message("Refactored %s", filename)
             if self.show_diffs:
                 for line in diff_texts(old, new, filename):
-                    try:
-                        print(line)
-                    except:
-                        pass
-
+                    print(line.encode('utf-8', 'ignore'))
 
 def warn(msg):
     print("WARNING: %s" % (msg,), file=sys.stderr)