##// END OF EJS Templates
Fix writing git commit ID to a file on build with Python 3.
Thomas Kluyver -
Show More
@@ -20,7 +20,6 b' from __future__ import print_function'
20 20 #-------------------------------------------------------------------------------
21 21 # Imports
22 22 #-------------------------------------------------------------------------------
23 import io
24 23 import os
25 24 import sys
26 25
@@ -55,11 +54,6 b' except NameError:'
55 54 locs = locs or globs
56 55 exec(compile(open(fname).read(), fname, "exec"), globs, locs)
57 56
58 try:
59 unicode
60 except NameError:
61 unicode = str
62
63 57 # A little utility we'll need below, since glob() does NOT allow you to do
64 58 # exclusion on multiple endings!
65 59 def file_doesnt_endwith(test,endings):
@@ -396,9 +390,9 b' def record_commit_info(pkg_dir, build_cmd=build_py):'
396 390 repo_commit = repo_commit.strip()
397 391 # We write the installation commit even if it's empty
398 392 out_pth = pjoin(self.build_lib, pkg_dir, 'utils', '_sysinfo.py')
399 with io.open(out_pth, 'w') as out_file:
400 out_file.writelines(map(unicode, [
393 with open(out_pth, 'w') as out_file:
394 out_file.writelines([
401 395 '# GENERATED BY setup.py\n',
402 'commit = "%s"\n' % repo_commit,
403 ]))
396 'commit = "%s"\n' % repo_commit.decode('ascii'),
397 ])
404 398 return MyBuildPy
General Comments 0
You need to be logged in to leave comments. Login now