diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-01-04 15:09:23 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-01-07 13:13:02 -0500 |
commit | e35fe8d58f18bd179efdc848c617dc9eddf4478b (patch) | |
tree | 333f23326e4870ce33f0fcead6488e1be9b2788f | |
parent | 34bc02c7bc8b7e8c267e6da9a8c35a6c25f1b72e (diff) | |
download | haskell-e35fe8d58f18bd179efdc848c617dc9eddf4478b.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.py | 3 |
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: |