setup.py
changeset 46869 ed286d150aa8
parent 46819 d4ba4d51f85f
child 46996 8d2b62d716b0
--- a/setup.py	Sat Apr 03 20:26:45 2021 -0400
+++ b/setup.py	Sat Apr 03 21:15:45 2021 -0400
@@ -817,6 +817,22 @@
                 if not os.path.exists(dest):
                     shutil.copy(buf.value, dest)
 
+                # Also overwrite python3.dll so that hgext.git is usable.
+                # TODO: also handle the MSYS flavor
+                if sys.version_info[0] >= 3:
+                    python_x = os.path.join(
+                        os.path.dirname(fsdecode(buf.value)),
+                        "python3.dll",
+                    )
+
+                    if os.path.exists(python_x):
+                        dest = os.path.join(
+                            os.path.dirname(self.hgtarget),
+                            os.path.basename(python_x),
+                        )
+
+                        shutil.copy(python_x, dest)
+
         if not pythonlib:
             log.warn(
                 'could not determine Python DLL filename; assuming pythonXY'