Commit e35fe8d5 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot

testsuite: Fix Windows platform test

Previously we used platform.system() and while this worked fine (e.g.
returned `Windows`, as expected) locally under both msys and MingW64
Python distributions, it inexplicably returned `MINGW64_NT-10.0`
under MingW64 Python on CI. It seems os.name is more reliable so we now
use that instead..
parent 34bc02c7
Pipeline #14323 failed with stages
in 681 minutes and 36 seconds
import os import os
import platform
import subprocess import subprocess
import shutil import shutil
from pathlib import Path, PurePath from pathlib import Path, PurePath
...@@ -83,7 +82,7 @@ def testing_metrics(): ...@@ -83,7 +82,7 @@ def testing_metrics():
# #
# We define the following function to make this magic more # We define the following function to make this magic more
# explicit/discoverable. You are encouraged to use it instead of os.symlink. # explicit/discoverable. You are encouraged to use it instead of os.symlink.
if platform.system() == 'Windows' and os.getenv('FORCE_SYMLINKS') == None: if os.name == 'nt' and os.getenv('FORCE_SYMLINKS') == None:
def link_or_copy_file(src: Path, dst: Path): def link_or_copy_file(src: Path, dst: Path):
shutil.copyfile(str(src), str(dst)) shutil.copyfile(str(src), str(dst))
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment