setup.py
changeset 40397 36b134c436b8
parent 40383 a9e303dcd1e1
child 40446 b6bc2293cdf3
--- a/setup.py	Fri Oct 19 18:32:13 2018 -0400
+++ b/setup.py	Fri Oct 19 18:34:42 2018 -0400
@@ -631,8 +631,14 @@
         with open('mercurial/hgpythonlib.h', 'wb') as f:
             f.write(b'/* this file is autogenerated by setup.py */\n')
             f.write(b'#define HGPYTHONLIB "%s"\n' % pythonlib)
+
+        macros = None
+        if sys.version_info[0] >= 3:
+            macros = [('_UNICODE', None), ('UNICODE', None)]
+
         objects = self.compiler.compile(['mercurial/exewrapper.c'],
-                                         output_dir=self.build_temp)
+                                         output_dir=self.build_temp,
+                                         macros=macros)
         dir = os.path.dirname(self.get_ext_fullpath('dummy'))
         self.hgtarget = os.path.join(dir, 'hg')
         self.compiler.link_executable(objects, self.hgtarget,