# HG changeset patch # User Augie Fackler # Date 1520114885 18000 # Node ID b76248e51605c67612f0a31517e778bbb85e582d # Parent 11b279a75bf1cc7f418bc5600624abc26583294e scmutil: avoid using basestring and add explicit handling of unicodes This resolves some Python 3 defects, and I don't think it is a meaningful behavior change in Python 2. Differential Revision: https://phab.mercurial-scm.org/D2611 diff -r 11b279a75bf1 -r b76248e51605 mercurial/scmutil.py --- a/mercurial/scmutil.py Sat Mar 03 17:07:18 2018 -0500 +++ b/mercurial/scmutil.py Sat Mar 03 17:08:05 2018 -0500 @@ -186,7 +186,10 @@ ui.warn(_("(%s)\n") % inst.hint) except error.ResponseError as inst: ui.warn(_("abort: %s") % inst.args[0]) - if not isinstance(inst.args[1], basestring): + msg = inst.args[1] + if isinstance(msg, type(u'')): + msg = pycompat.sysbytes(msg) + elif not isinstance(inst.args[1], bytes): ui.warn(" %r\n" % (inst.args[1],)) elif not inst.args[1]: ui.warn(_(" empty string\n"))