Show More
@@ -780,9 +780,6 b' class buildhgexe(build_ext):' | |||
|
780 | 780 | |
|
781 | 781 | pythonlib = None |
|
782 | 782 | |
|
783 | dir = os.path.dirname(self.get_ext_fullpath('dummy')) | |
|
784 | self.hgtarget = os.path.join(dir, 'hg') | |
|
785 | ||
|
786 | 783 | if getattr(sys, 'dllhandle', None): |
|
787 | 784 | # Different Python installs can have different Python library |
|
788 | 785 | # names. e.g. the official CPython distribution uses pythonXY.dll |
@@ -808,35 +805,6 b' class buildhgexe(build_ext):' | |||
|
808 | 805 | ) |
|
809 | 806 | pythonlib = dllbasename[:-4] |
|
810 | 807 | |
|
811 | # Copy the pythonXY.dll next to the binary so that it runs | |
|
812 | # without tampering with PATH. | |
|
813 | fsdecode = lambda x: x | |
|
814 | if sys.version_info[0] >= 3: | |
|
815 | fsdecode = os.fsdecode | |
|
816 | dest = os.path.join( | |
|
817 | os.path.dirname(self.hgtarget), | |
|
818 | fsdecode(dllbasename), | |
|
819 | ) | |
|
820 | ||
|
821 | if not os.path.exists(dest): | |
|
822 | shutil.copy(buf.value, dest) | |
|
823 | ||
|
824 | # Also overwrite python3.dll so that hgext.git is usable. | |
|
825 | # TODO: also handle the MSYS flavor | |
|
826 | if sys.version_info[0] >= 3: | |
|
827 | python_x = os.path.join( | |
|
828 | os.path.dirname(fsdecode(buf.value)), | |
|
829 | "python3.dll", | |
|
830 | ) | |
|
831 | ||
|
832 | if os.path.exists(python_x): | |
|
833 | dest = os.path.join( | |
|
834 | os.path.dirname(self.hgtarget), | |
|
835 | os.path.basename(python_x), | |
|
836 | ) | |
|
837 | ||
|
838 | shutil.copy(python_x, dest) | |
|
839 | ||
|
840 | 808 | if not pythonlib: |
|
841 | 809 | log.warn( |
|
842 | 810 | 'could not determine Python DLL filename; assuming pythonXY' |
@@ -859,6 +827,8 b' class buildhgexe(build_ext):' | |||
|
859 | 827 | output_dir=self.build_temp, |
|
860 | 828 | macros=macros, |
|
861 | 829 | ) |
|
830 | dir = os.path.dirname(self.get_ext_fullpath('dummy')) | |
|
831 | self.hgtarget = os.path.join(dir, 'hg') | |
|
862 | 832 | self.compiler.link_executable( |
|
863 | 833 | objects, self.hgtarget, libraries=[], output_dir=self.build_temp |
|
864 | 834 | ) |
General Comments 0
You need to be logged in to leave comments.
Login now