diff --git a/mercurial/color.py b/mercurial/color.py --- a/mercurial/color.py +++ b/mercurial/color.py @@ -171,12 +171,12 @@ for key, (b, e, c) in ui._terminfoparams.copy().items(): if not b: continue - if not c and not curses.tigetstr(e): + if not c and not curses.tigetstr(pycompat.sysstr(e)): # Most terminals don't support dim, invis, etc, so don't be # noisy and use ui.debug(). ui.debug("no terminfo entry for %s\n" % e) del ui._terminfoparams[key] - if not curses.tigetstr('setaf') or not curses.tigetstr('setab'): + if not curses.tigetstr(r'setaf') or not curses.tigetstr(r'setab'): # Only warn about missing terminfo entries if we explicitly asked for # terminfo mode and we're in a formatted terminal. if mode == "terminfo" and formatted: @@ -325,11 +325,11 @@ if termcode: return termcode else: - return curses.tigetstr(val) + return curses.tigetstr(pycompat.sysstr(val)) elif bg: - return curses.tparm(curses.tigetstr('setab'), val) + return curses.tparm(curses.tigetstr(r'setab'), val) else: - return curses.tparm(curses.tigetstr('setaf'), val) + return curses.tparm(curses.tigetstr(r'setaf'), val) def _mergeeffects(text, start, stop): """Insert start sequence at every occurrence of stop sequence