comparison tests/run-tests.py @ 33931:7cab956794e4

run-tests: pass unicode to Pygments This is required on Python 3, and is more correct on Python 2 because Pygments is a unicode library.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 24 Aug 2017 22:20:02 +0900
parents f5d4bb8e944d
children 6cc8f848b4c3
comparison
equal deleted inserted replaced
33930:f5d4bb8e944d 33931:7cab956794e4
613 613
614 def highlightdiff(line, color): 614 def highlightdiff(line, color):
615 if not color: 615 if not color:
616 return line 616 return line
617 assert pygmentspresent 617 assert pygmentspresent
618 return pygments.highlight(line, difflexer, terminal256formatter) 618 return pygments.highlight(line.decode('latin1'), difflexer,
619 terminal256formatter).encode('latin1')
619 620
620 def highlightmsg(msg, color): 621 def highlightmsg(msg, color):
621 if not color: 622 if not color:
622 return msg 623 return msg
623 assert pygmentspresent 624 assert pygmentspresent