comparison setup.py @ 46869:ed286d150aa8

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
author Matt Harbison <matt_harbison@yahoo.com>
date Sat, 03 Apr 2021 21:15:45 -0400
parents d4ba4d51f85f
children 8d2b62d716b0
comparison
equal deleted inserted replaced
46868:802ba3c81507 46869:ed286d150aa8
814 fsdecode(dllbasename), 814 fsdecode(dllbasename),
815 ) 815 )
816 816
817 if not os.path.exists(dest): 817 if not os.path.exists(dest):
818 shutil.copy(buf.value, dest) 818 shutil.copy(buf.value, dest)
819
820 # Also overwrite python3.dll so that hgext.git is usable.
821 # TODO: also handle the MSYS flavor
822 if sys.version_info[0] >= 3:
823 python_x = os.path.join(
824 os.path.dirname(fsdecode(buf.value)),
825 "python3.dll",
826 )
827
828 if os.path.exists(python_x):
829 dest = os.path.join(
830 os.path.dirname(self.hgtarget),
831 os.path.basename(python_x),
832 )
833
834 shutil.copy(python_x, dest)
819 835
820 if not pythonlib: 836 if not pythonlib:
821 log.warn( 837 log.warn(
822 'could not determine Python DLL filename; assuming pythonXY' 838 'could not determine Python DLL filename; assuming pythonXY'
823 ) 839 )