##// END OF EJS Templates
py3: replace "if ispy3" by pycompat.sysbytes() or util.forcebytestr()
Yuya Nishihara -
r35917:d5457d94 default
parent child Browse files
Show More
@@ -939,9 +939,9 b' def _exceptionwarning(ui):'
939 worst = None, ct, ''
939 worst = None, ct, ''
940 if ui.config('ui', 'supportcontact') is None:
940 if ui.config('ui', 'supportcontact') is None:
941 for name, mod in extensions.extensions():
941 for name, mod in extensions.extensions():
942 testedwith = getattr(mod, 'testedwith', '')
942 # 'testedwith' should be bytes, but not all extensions are ported
943 if pycompat.ispy3 and isinstance(testedwith, str):
943 # to py3 and we don't want UnicodeException because of that.
944 testedwith = testedwith.encode(u'utf-8')
944 testedwith = util.forcebytestr(getattr(mod, 'testedwith', ''))
945 report = getattr(mod, 'buglink', _('the extension author.'))
945 report = getattr(mod, 'buglink', _('the extension author.'))
946 if not testedwith.strip():
946 if not testedwith.strip():
947 # We found an untested extension. It's likely the culprit.
947 # We found an untested extension. It's likely the culprit.
@@ -976,11 +976,7 b' def _exceptionwarning(ui):'
976 bugtracker = _("https://mercurial-scm.org/wiki/BugTracker")
976 bugtracker = _("https://mercurial-scm.org/wiki/BugTracker")
977 warning = (_("** unknown exception encountered, "
977 warning = (_("** unknown exception encountered, "
978 "please report by visiting\n** ") + bugtracker + '\n')
978 "please report by visiting\n** ") + bugtracker + '\n')
979 if pycompat.ispy3:
979 sysversion = pycompat.sysbytes(sys.version).replace('\n', '')
980 sysversion = sys.version.encode(u'utf-8')
981 else:
982 sysversion = sys.version
983 sysversion = sysversion.replace('\n', '')
984 warning += ((_("** Python %s\n") % sysversion) +
980 warning += ((_("** Python %s\n") % sysversion) +
985 (_("** Mercurial Distributed SCM (version %s)\n") %
981 (_("** Mercurial Distributed SCM (version %s)\n") %
986 util.version()) +
982 util.version()) +
General Comments 0
You need to be logged in to leave comments. Login now