Skip to content
Snippets Groups Projects
Commit ed286d15 authored by Matt Harbison's avatar Matt Harbison
Browse files

setup: copy python3.dll next to hg.exe when building on Windows for hgext.git

I thought I took care of this already, but it must have been that I just
manually copied the file over locally when debugging why the pygit2 library
wasn't loading.  The problem with that is what was copied over was from py38,
and then running a py39 build hard crashed when the extension was loaded.

Differential Revision: https://phab.mercurial-scm.org/D10301
parent 802ba3c8
No related branches found
No related tags found
No related merge requests found
......@@ -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'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment