comparison mercurial/dagparser.py @ 34137:a8994d08e4a2

doctest: use print_function and convert bytes to unicode where needed
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 14:56:31 +0900
parents 0fa781320203
children 0f9936d80e01
comparison
equal deleted inserted replaced
34136:414a3513c2bd 34137:a8994d08e4a2
153 >>> list(parsedag(b'+1 # comment\\n+1')) 153 >>> list(parsedag(b'+1 # comment\\n+1'))
154 [('n', (0, [-1])), ('n', (1, [0]))] 154 [('n', (0, [-1])), ('n', (1, [0]))]
155 155
156 Error: 156 Error:
157 157
158 >>> from . import pycompat
158 >>> try: list(parsedag(b'+1 bad')) 159 >>> try: list(parsedag(b'+1 bad'))
159 ... except Exception, e: print(e) 160 ... except Exception, e: print(pycompat.sysstr(bytes(e)))
160 invalid character in dag description: bad... 161 invalid character in dag description: bad...
161 162
162 ''' 163 '''
163 if not desc: 164 if not desc:
164 return 165 return