##// END OF EJS Templates
handle unicode exception messages in xmode plain
Min RK -
Show More
@@ -709,10 +709,10 b' class ListTB(TBTools):'
709 have_filedata = False
709 have_filedata = False
710 Colors = self.Colors
710 Colors = self.Colors
711 list = []
711 list = []
712 stype = Colors.excName + etype.__name__ + Colors.Normal
712 stype = py3compat.cast_unicode(Colors.excName + etype.__name__ + Colors.Normal)
713 if value is None:
713 if value is None:
714 # Not sure if this can still happen in Python 2.6 and above
714 # Not sure if this can still happen in Python 2.6 and above
715 list.append(py3compat.cast_unicode(stype) + '\n')
715 list.append(stype + '\n')
716 else:
716 else:
717 if issubclass(etype, SyntaxError):
717 if issubclass(etype, SyntaxError):
718 have_filedata = True
718 have_filedata = True
@@ -752,10 +752,10 b' class ListTB(TBTools):'
752 except Exception:
752 except Exception:
753 s = self._some_str(value)
753 s = self._some_str(value)
754 if s:
754 if s:
755 list.append('%s%s:%s %s\n' % (str(stype), Colors.excName,
755 list.append('%s%s:%s %s\n' % (stype, Colors.excName,
756 Colors.Normal, s))
756 Colors.Normal, s))
757 else:
757 else:
758 list.append('%s\n' % str(stype))
758 list.append('%s\n' % stype)
759
759
760 # sync with user hooks
760 # sync with user hooks
761 if have_filedata:
761 if have_filedata:
@@ -793,9 +793,9 b' class ListTB(TBTools):'
793 def _some_str(self, value):
793 def _some_str(self, value):
794 # Lifted from traceback.py
794 # Lifted from traceback.py
795 try:
795 try:
796 return str(value)
796 return py3compat.cast_unicode(str(value))
797 except:
797 except:
798 return '<unprintable %s object>' % type(value).__name__
798 return u'<unprintable %s object>' % type(value).__name__
799
799
800
800
801 #----------------------------------------------------------------------------
801 #----------------------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now