changeset 42075:456c37433c43

py3: write out hgextindex as bytes in setup.py I hit this trying to build the py2exe target using python3, just to see what would happen. After commenting out `py2exe.Distribution` in setup.py and pointing to a local copy of py2exe that supports python3[1], it complained that `out` was bytes, not str. [1] https://github.com/albertosottile/py2exe/releases/tag/v0.9.3.0
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 05 Apr 2019 18:36:43 -0400
parents 59b1bdf85b1a
children f46c1a9b1bfe
files setup.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/setup.py	Thu Apr 04 15:40:48 2019 +0200
+++ b/setup.py	Fri Apr 05 18:36:43 2019 -0400
@@ -583,9 +583,9 @@
         if err or returncode != 0:
             raise DistutilsExecError(err)
 
-        with open(self._indexfilename, 'w') as f:
-            f.write('# this file is autogenerated by setup.py\n')
-            f.write('docs = ')
+        with open(self._indexfilename, 'wb') as f:
+            f.write(b'# this file is autogenerated by setup.py\n')
+            f.write(b'docs = ')
             f.write(out)
 
 class buildhgexe(build_ext):