##// END OF EJS Templates
py3: use pycompat.bytestr instead of bytes
Pulkit Goyal -
r32154:52e222ee default
parent child Browse files
Show More
@@ -53,6 +53,7 b' def tokenize(program, start, end, term=N'
53 """Parse a template expression into a stream of tokens, which must end
53 """Parse a template expression into a stream of tokens, which must end
54 with term if specified"""
54 with term if specified"""
55 pos = start
55 pos = start
56 program = pycompat.bytestr(program)
56 while pos < end:
57 while pos < end:
57 c = program[pos]
58 c = program[pos]
58 if c.isspace(): # skip inter-token whitespace
59 if c.isspace(): # skip inter-token whitespace
@@ -1913,6 +1913,7 b' def strdate(string, format, defaults=Non'
1913 # add missing elements from defaults
1913 # add missing elements from defaults
1914 usenow = False # default to using biased defaults
1914 usenow = False # default to using biased defaults
1915 for part in ("S", "M", "HI", "d", "mb", "yY"): # decreasing specificity
1915 for part in ("S", "M", "HI", "d", "mb", "yY"): # decreasing specificity
1916 part = pycompat.bytestr(part)
1916 found = [True for p in part if ("%"+p) in format]
1917 found = [True for p in part if ("%"+p) in format]
1917 if not found:
1918 if not found:
1918 date += "@" + defaults[part][usenow]
1919 date += "@" + defaults[part][usenow]
General Comments 0
You need to be logged in to leave comments. Login now