setup.py
changeset 39608 ec68135a8935
parent 39572 b6b9488aae4c
child 39613 96bffce40f5b
--- a/setup.py	Thu Sep 13 18:09:22 2018 -0400
+++ b/setup.py	Thu Sep 13 12:37:32 2018 -0400
@@ -610,7 +610,7 @@
 
         if filelen > 0 and filelen != size:
             dllbasename = os.path.basename(buf.value)
-            if not dllbasename.lower().endswith('.dll'):
+            if not dllbasename.lower().endswith(b'.dll'):
                 raise SystemExit('Python DLL does not end with .dll: %s' %
                                  dllbasename)
             pythonlib = dllbasename[:-4]
@@ -623,8 +623,8 @@
 
         log.info('using %s as Python library name' % pythonlib)
         with open('mercurial/hgpythonlib.h', 'wb') as f:
-            f.write('/* this file is autogenerated by setup.py */\n')
-            f.write('#define HGPYTHONLIB "%s"\n' % pythonlib)
+            f.write(b'/* this file is autogenerated by setup.py */\n')
+            f.write(b'#define HGPYTHONLIB "%s"\n' % pythonlib)
         objects = self.compiler.compile(['mercurial/exewrapper.c'],
                                          output_dir=self.build_temp)
         dir = os.path.dirname(self.get_ext_fullpath('dummy'))
@@ -1000,7 +1000,7 @@
 if os.name == 'nt':
     # Windows binary file versions for exe/dll files must have the
     # form W.X.Y.Z, where W,X,Y,Z are numbers in the range 0..65535
-    setupversion = version.split('+', 1)[0]
+    setupversion = version.split(b'+', 1)[0]
 
 if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
     version = runcmd(['/usr/bin/xcodebuild', '-version'], {})[1].splitlines()