Show More
@@ -7,14 +7,12 b'' | |||
|
7 | 7 | |
|
8 | 8 | |
|
9 | 9 | import abc |
|
10 | import builtins | |
|
10 | 11 | import re |
|
11 | import sys | |
|
12 | 12 | |
|
13 | 13 | #################### |
|
14 | 14 | # for Python3 compatibility (almost comes from mercurial/pycompat.py) |
|
15 | 15 | |
|
16 | ispy3 = sys.version_info[0] >= 3 | |
|
17 | ||
|
18 | 16 | |
|
19 | 17 | def identity(a): |
|
20 | 18 | return a |
@@ -38,29 +36,21 b' def rapply(f, xs):' | |||
|
38 | 36 | return _rapply(f, xs) |
|
39 | 37 | |
|
40 | 38 | |
|
41 | if ispy3: | |
|
42 | import builtins | |
|
43 | ||
|
44 | 39 |
|
|
45 | 40 |
|
|
46 | 41 |
|
|
47 | 42 | |
|
43 | ||
|
48 | 44 |
|
|
49 | 45 |
|
|
50 | 46 |
|
|
51 | 47 |
|
|
52 | 48 | |
|
49 | ||
|
53 | 50 |
|
|
54 | 51 |
|
|
55 | 52 | |
|
56 | 53 | |
|
57 | else: | |
|
58 | bytestr = str | |
|
59 | sysstr = identity | |
|
60 | ||
|
61 | opentext = open | |
|
62 | ||
|
63 | ||
|
64 | 54 | def b2s(x): |
|
65 | 55 | # convert BYTES elements in "x" to SYSSTR recursively |
|
66 | 56 | return rapply(sysstr, x) |
General Comments 0
You need to be logged in to leave comments.
Login now