Show More
@@ -13,6 +13,7 b' import string' | |||
|
13 | 13 | from .i18n import _ |
|
14 | 14 | from . import ( |
|
15 | 15 | error, |
|
16 | pycompat, | |
|
16 | 17 | util, |
|
17 | 18 | ) |
|
18 | 19 | |
@@ -158,7 +159,6 b' def parsedag(desc):' | |||
|
158 | 159 | |
|
159 | 160 | Error: |
|
160 | 161 | |
|
161 | >>> from . import pycompat | |
|
162 | 162 | >>> try: list(parsedag(b'+1 bad')) |
|
163 | 163 | ... except Exception as e: print(pycompat.sysstr(bytes(e))) |
|
164 | 164 | invalid character in dag description: bad... |
@@ -167,7 +167,7 b' def parsedag(desc):' | |||
|
167 | 167 | if not desc: |
|
168 | 168 | return |
|
169 | 169 | |
|
170 | wordchars = string.ascii_letters + string.digits | |
|
170 | wordchars = pycompat.bytestr(string.ascii_letters + string.digits) | |
|
171 | 171 | |
|
172 | 172 | labels = {} |
|
173 | 173 | p1 = -1 |
@@ -176,7 +176,7 b' def parsedag(desc):' | |||
|
176 | 176 | def resolve(ref): |
|
177 | 177 | if not ref: |
|
178 | 178 | return p1 |
|
179 | elif ref[0] in string.digits: | |
|
179 | elif ref[0] in pycompat.bytestr(string.digits): | |
|
180 | 180 | return r - int(ref) |
|
181 | 181 | else: |
|
182 | 182 | return labels[ref] |
@@ -210,7 +210,7 b' def parsedag(desc):' | |||
|
210 | 210 | |
|
211 | 211 | c = nextch() |
|
212 | 212 | while c != '\0': |
|
213 | while c in string.whitespace: | |
|
213 | while c in pycompat.bytestr(string.whitespace): | |
|
214 | 214 | c = nextch() |
|
215 | 215 | if c == '.': |
|
216 | 216 | yield 'n', (r, [p1]) |
@@ -218,7 +218,7 b' def parsedag(desc):' | |||
|
218 | 218 | r += 1 |
|
219 | 219 | c = nextch() |
|
220 | 220 | elif c == '+': |
|
221 | c, digs = nextrun(nextch(), string.digits) | |
|
221 | c, digs = nextrun(nextch(), pycompat.bytestr(string.digits)) | |
|
222 | 222 | n = int(digs) |
|
223 | 223 | for i in xrange(0, n): |
|
224 | 224 | yield 'n', (r, [p1]) |
General Comments 0
You need to be logged in to leave comments.
Login now