# HG changeset patch # User Yuya Nishihara # Date 1504420119 -32400 # Node ID a48ad118c5583fa3a637139d9d63c804b43b6b28 # Parent 8927534cacbc0660b234ebdff24a95035043f0d8 py3: wrap string constants in dagparser.py with bytestr() diff -r 8927534cacbc -r a48ad118c558 mercurial/dagparser.py --- a/mercurial/dagparser.py Sun Sep 03 15:25:50 2017 +0900 +++ b/mercurial/dagparser.py Sun Sep 03 15:28:39 2017 +0900 @@ -13,6 +13,7 @@ from .i18n import _ from . import ( error, + pycompat, util, ) @@ -158,7 +159,6 @@ Error: - >>> from . import pycompat >>> try: list(parsedag(b'+1 bad')) ... except Exception as e: print(pycompat.sysstr(bytes(e))) invalid character in dag description: bad... @@ -167,7 +167,7 @@ if not desc: return - wordchars = string.ascii_letters + string.digits + wordchars = pycompat.bytestr(string.ascii_letters + string.digits) labels = {} p1 = -1 @@ -176,7 +176,7 @@ def resolve(ref): if not ref: return p1 - elif ref[0] in string.digits: + elif ref[0] in pycompat.bytestr(string.digits): return r - int(ref) else: return labels[ref] @@ -210,7 +210,7 @@ c = nextch() while c != '\0': - while c in string.whitespace: + while c in pycompat.bytestr(string.whitespace): c = nextch() if c == '.': yield 'n', (r, [p1]) @@ -218,7 +218,7 @@ r += 1 c = nextch() elif c == '+': - c, digs = nextrun(nextch(), string.digits) + c, digs = nextrun(nextch(), pycompat.bytestr(string.digits)) n = int(digs) for i in xrange(0, n): yield 'n', (r, [p1])