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-08 12:55:45 -0500
commitca69875aec9aaeb8b3d96bf5cafbee39841ea957 (patch)
tree5682fa841a30f1ec6fd50ee82cb4b1966e912b7e
parent196eec1a8e4c5a93238ff07585eea88ab08b581e (diff)
downloadhaskell-ca69875aec9aaeb8b3d96bf5cafbee39841ea957.tar.gz
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..
-rw-r--r--testsuite/driver/testutil.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/driver/testutil.py b/testsuite/driver/testutil.py
index 071b641b7f..aa12c31690 100644
--- a/testsuite/driver/testutil.py
+++ b/testsuite/driver/testutil.py
@@ -87,8 +87,8 @@ def testing_metrics():
# are forced to just copy instead.
#
# We define the following function to make this magic more
-# explicit/discoverable. You are enouraged to use it instead of os.symlink.
-if platform.system() == 'Windows' and os.getenv('FORCE_SYMLINKS') == None:
+# explicit/discoverable. You are encouraged to use it instead of os.symlink.
+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: