summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-01-04 15:09:23 -0500
committerBen Gamari <ben@smart-cactus.org>2020-01-06 13:04:00 -0500
commitcfdf52392666e63cc370c647b1bec487a30a916a (patch)
tree926e46c36624577185cffff71649b0152c471bf9
parent668cda33b3a95e355cc25ba850260b30d05c6619 (diff)
downloadhaskell-wip/T17607.tar.gz
testsuite: Fix Windows platform testwip/T17607
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..
-rw-r--r--testsuite/driver/testutil.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py
index e33b6a16ab..62b76c75fd 100644
--- a/testsuite/driver/testutil.py
+++ b/testsuite/driver/testutil.py
@@ -1,5 +1,4 @@
import os
-import platform
import subprocess
import shutil
from pathlib import Path, PurePath
@@ -83,7 +82,7 @@ def testing_metrics():
#
# We define the following function to make this magic more
# 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):
shutil.copyfile(str(src), str(dst))
else: