setup.py
changeset 31316 70bc35df3e54
parent 31308 62939e0148f1
child 31559 9639ff4a93ae
--- a/setup.py	Wed Jan 14 01:15:26 2015 +0100
+++ b/setup.py	Sat Mar 11 17:14:02 2017 -0800
@@ -661,7 +661,14 @@
             packagedata['mercurial'].append(f)
 
 datafiles = []
-setupversion = version
+
+# distutils expects version to be str/unicode. Converting it to
+# unicode on Python 2 still works because it won't contain any
+# non-ascii bytes and will be implicitly converted back to bytes
+# when operated on.
+assert isinstance(version, bytes)
+setupversion = version.decode('ascii')
+
 extra = {}
 
 if py2exeloaded: