diff options
author | Steve Dower <steve.dower@python.org> | 2022-04-06 10:56:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-06 10:56:31 (GMT) |
commit | 074da788028c1f1e867dc81698efdcdc263f2288 (patch) | |
tree | c06fe457e6cd7232a80bdd6b918f4b862a53c199 /Lib/test | |
parent | 35bcf9f3c19dfbb368c08e3aa75fda72a23c030d (diff) | |
download | cpython-074da788028c1f1e867dc81698efdcdc263f2288.zip cpython-074da788028c1f1e867dc81698efdcdc263f2288.tar.gz cpython-074da788028c1f1e867dc81698efdcdc263f2288.tar.bz2 |
bpo-47103: Copy pgort140.dll into output directory when building PGInstrument on Windows (GH-32083)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_embed.py | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 7e5e4c1..16d1c7d 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -1206,20 +1206,11 @@ class InitConfigTests(EmbeddingTestsMixin, unittest.TestCase): 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)) |