##// END OF EJS Templates
setup: convert version strings to unicode on Python 3...
Yuya Nishihara -
r35246:d73ccc63 default
parent child Browse files
Show More
@@ -29,12 +29,16 b' import sys, platform'
29 29 if sys.version_info[0] >= 3:
30 30 printf = eval('print')
31 31 libdir_escape = 'unicode_escape'
32 def sysstr(s):
33 return s.decode('latin-1')
32 34 else:
33 35 libdir_escape = 'string_escape'
34 36 def printf(*args, **kwargs):
35 37 f = kwargs.get('file', sys.stdout)
36 38 end = kwargs.get('end', '\n')
37 39 f.write(b' '.join(args) + end)
40 def sysstr(s):
41 return s
38 42
39 43 # Attempt to guide users to a modern pip - this means that 2.6 users
40 44 # should have a chance of getting a 4.2 release, and when we ratchet
@@ -295,8 +299,8 b" version = ''"
295 299 if os.path.isdir('.hg'):
296 300 hg = findhg()
297 301 cmd = ['log', '-r', '.', '--template', '{tags}\n']
298 numerictags = [t for t in hg.run(cmd).split() if t[0:1].isdigit()]
299 hgid = hg.run(['id', '-i']).strip()
302 numerictags = [t for t in sysstr(hg.run(cmd)).split() if t[0:1].isdigit()]
303 hgid = sysstr(hg.run(['id', '-i'])).strip()
300 304 if not hgid:
301 305 # Bail out if hg is having problems interacting with this repository,
302 306 # rather than falling through and producing a bogus version number.
@@ -309,7 +313,7 b" if os.path.isdir('.hg'):"
309 313 version += '+'
310 314 else: # no tag found
311 315 ltagcmd = ['parents', '--template', '{latesttag}']
312 ltag = hg.run(ltagcmd)
316 ltag = sysstr(hg.run(ltagcmd))
313 317 changessincecmd = ['log', '-T', 'x\n', '-r', "only(.,'%s')" % ltag]
314 318 changessince = len(hg.run(changessincecmd).splitlines())
315 319 version = '%s+%s-%s' % (ltag, changessince, hgid)
General Comments 0
You need to be logged in to leave comments. Login now