fix sdist build in Py3
authorStefan Behnel <scoder@users.berlios.de>
Tue, 9 Mar 2010 15:24:07 +0000 (16:24 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 9 Mar 2010 15:24:07 +0000 (16:24 +0100)
setup.py

index da55aa931072a92ab208229f870023a538870102..9a9e02f37e35a1efaa5f110c22e5718083337965 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,13 +3,13 @@ from distutils.sysconfig import get_python_lib
 import os, os.path
 import sys
 
-if 'sdist' in sys.argv:
+if 'sdist' in sys.argv and sys.platform != "win32":
     # Record the current revision in .hgrev
     import subprocess # os.popen is cleaner but depricated
     changset = subprocess.Popen("hg log --rev tip | grep changeset", 
                                 shell=True,
                                 stdout=subprocess.PIPE).stdout.read()
-    rev = changset.split(':')[-1].strip()
+    rev = changset.decode('ISO-8859-1').split(':')[-1].strip()
     hgrev = open('.hgrev', 'w')
     hgrev.write(rev)
     hgrev.close()