diff --git a/setupbase.py b/setupbase.py index fe6e357..0bf0bb1 100644 --- a/setupbase.py +++ b/setupbase.py @@ -20,7 +20,6 @@ from __future__ import print_function #------------------------------------------------------------------------------- # Imports #------------------------------------------------------------------------------- -import io import os import sys @@ -55,11 +54,6 @@ except NameError: locs = locs or globs exec(compile(open(fname).read(), fname, "exec"), globs, locs) -try: - unicode -except NameError: - unicode = str - # A little utility we'll need below, since glob() does NOT allow you to do # exclusion on multiple endings! def file_doesnt_endwith(test,endings): @@ -396,9 +390,9 @@ def record_commit_info(pkg_dir, build_cmd=build_py): repo_commit = repo_commit.strip() # We write the installation commit even if it's empty out_pth = pjoin(self.build_lib, pkg_dir, 'utils', '_sysinfo.py') - with io.open(out_pth, 'w') as out_file: - out_file.writelines(map(unicode, [ + with open(out_pth, 'w') as out_file: + out_file.writelines([ '# GENERATED BY setup.py\n', - 'commit = "%s"\n' % repo_commit, - ])) + 'commit = "%s"\n' % repo_commit.decode('ascii'), + ]) return MyBuildPy