diff --git a/IPython/utils/_sysinfo.py b/IPython/utils/_sysinfo.py index d3d9002..2e58242 100644 --- a/IPython/utils/_sysinfo.py +++ b/IPython/utils/_sysinfo.py @@ -1,2 +1,2 @@ # GENERATED BY setup.py -commit = '' +commit = "" diff --git a/setupbase.py b/setupbase.py index 8803e76..fe6e357 100644 --- a/setupbase.py +++ b/setupbase.py @@ -45,6 +45,9 @@ def oscmd(s): print(">", s) os.system(s) +# Py3 compatibility hacks, without assuming IPython itself is installed with +# the full py3compat machinery. + try: execfile except NameError: @@ -52,6 +55,11 @@ 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): @@ -389,8 +397,8 @@ def record_commit_info(pkg_dir, build_cmd=build_py): # 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([ - u"# GENERATED BY setup.py\n", - u"commit = '%s'\n" % repo_commit, - ]) + out_file.writelines(map(unicode, [ + '# GENERATED BY setup.py\n', + 'commit = "%s"\n' % repo_commit, + ])) return MyBuildPy