--- 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: