D3325: py3: make sure curses.tigetstr() first argument is a str

2018-04-13 Thread pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG483cafc3762a: py3: make sure curses.tigetstr() first 
argument is a str (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3325?vs=8145=8199

REVISION DETAIL
  https://phab.mercurial-scm.org/D3325

AFFECTED FILES
  mercurial/color.py

CHANGE DETAILS

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



To: pulkit, #hg-reviewers, durin42
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3325: py3: make sure curses.tigetstr() first argument is a str

2018-04-13 Thread pulkit (Pulkit Goyal)
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3325

AFFECTED FILES
  mercurial/color.py

CHANGE DETAILS

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



To: pulkit, #hg-reviewers
Cc: mercurial-devel, spectral
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel