bpo-47103: Copy pgort140.dll into output directory when building PGInstrument on Windows (GH-32083)

This commit is contained in:
Steve Dower 2022-04-07 23:21:03 +01:00 committed by GitHub
parent 877fd622e8
commit b0ec17b6d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 18 deletions

View file

@ -1195,20 +1195,11 @@ def tmpdir_with_python(self):
if MS_WINDOWS:
# Copy pythonXY.dll (or pythonXY_d.dll)
ver = sys.version_info
dll = f'python{ver.major}{ver.minor}'
dll3 = f'python{ver.major}'
if debug_build(sys.executable):
dll += '_d'
dll3 += '_d'
dll += '.dll'
dll3 += '.dll'
dll = os.path.join(os.path.dirname(self.test_exe), dll)
dll3 = os.path.join(os.path.dirname(self.test_exe), dll3)
dll_copy = os.path.join(tmpdir, os.path.basename(dll))
dll3_copy = os.path.join(tmpdir, os.path.basename(dll3))
shutil.copyfile(dll, dll_copy)
shutil.copyfile(dll3, dll3_copy)
import fnmatch
exedir = os.path.dirname(self.test_exe)
for f in os.listdir(exedir):
if fnmatch.fnmatch(f, '*.dll'):
shutil.copyfile(os.path.join(exedir, f), os.path.join(tmpdir, f))
# Copy Python program
exec_copy = os.path.join(tmpdir, os.path.basename(self.test_exe))