summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2021-01-21 13:10:36 -0500
committerBen Gamari <ben@smart-cactus.org>2021-01-26 09:49:55 -0500
commitdf7b2cce70fca3b18457ada1c973874dcc03e717 (patch)
tree62c3a4c2503230222087f62cc8f01297bd6517ab
parent37fbdd6f56ca1be57d9438c2e9aaf03416c38ed9 (diff)
downloadhaskell-df7b2cce70fca3b18457ada1c973874dcc03e717.tar.gz
compare-flags: Strip whitespace from flags read from --show-options
Otherwise we end up with terminating \r characters on Windows. (cherry picked from commit 08d8119447a3e17a125f88f2d0aedb51bc64bac7)
-rwxr-xr-xdocs/users_guide/compare-flags.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/users_guide/compare-flags.py b/docs/users_guide/compare-flags.py
index 5f0a1c9741..81a11b90e5 100755
--- a/docs/users_guide/compare-flags.py
+++ b/docs/users_guide/compare-flags.py
@@ -49,8 +49,8 @@ def read_documented_flags(doc_flags) -> Set[str]:
def read_ghc_flags(ghc_path: str) -> Set[str]:
ghc_output = subprocess.check_output([ghc_path, '--show-options'])
- return {flag
- for flag in ghc_output.decode('UTF-8').split('\n')
+ flags = {flag.strip() for flag in ghc_output.decode('UTF-8').split('\n')}
+ return {flag for flag in flags
if not expected_undocumented(flag)
if flag != ''}