Commits

Philip Jenvey committed a955992

revert part of ed5309c80fdf and adapt its test to this branch: py3k doesn't
need these workarounds

  • Participants
  • Parent commits 526680d
  • Branches py3k

Comments (0)

Files changed (2)

pypy/module/sys/app.py

         pass
 
     try:
-        encoding = sys.stderr.encoding
-    except:
-        encoding = None
-
-    try:
         from traceback import print_exception
-        print_exception(exctype, value, traceback, _encoding=encoding)
+        print_exception(exctype, value, traceback)
     except:
         if not excepthook_failsafe(exctype, value):
             raise

pypy/module/sys/test/test_sysmodule.py

             def getvalue(self):
                 return ''.join(self.output)
 
-        for input, expectedoutput in [(u"\u013a", "\xe5"),
-                                      (u"\u1111", "\\u1111")]:
+        for input in ("\u013a", "\u1111"):
             err = MyStringIO()
             err.encoding = 'iso-8859-2'
             sys.stderr = err
             eh = sys.__excepthook__
             try:
                 raise ValueError(input)
-            except ValueError, exc:
+            except ValueError as exc:
                 eh(*sys.exc_info())
 
             sys.stderr = savestderr
-            print repr(err.getvalue())
-            assert err.getvalue().endswith("ValueError: %s\n" % expectedoutput)
+            print(ascii(err.getvalue()))
+            assert err.getvalue().endswith("ValueError: %s\n" % input)
 
     # FIXME: testing the code for a lost or replaced excepthook in
     # Python/pythonrun.c::PyErr_PrintEx() is tricky.