summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-06-15 03:33:33 (GMT)
committerGitHub <noreply@github.com>2020-06-15 03:33:33 (GMT)
commit5fc4f8ae68aecf07f2ae4029dbcf997027489944 (patch)
treeb192617e0809b304f8ba1b0a13da7b9cdc14b39a
parent78319e373d57cd4da67660f888aa7092efbd6f24 (diff)
downloadcpython-5fc4f8ae68aecf07f2ae4029dbcf997027489944.zip
cpython-5fc4f8ae68aecf07f2ae4029dbcf997027489944.tar.gz
cpython-5fc4f8ae68aecf07f2ae4029dbcf997027489944.tar.bz2
Fix trailing whitespace in keyword.py (GH-20881)
-rw-r--r--Tools/peg_generator/pegen/keywordgen.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/peg_generator/pegen/keywordgen.py b/Tools/peg_generator/pegen/keywordgen.py
index 639f01b..53638b1 100644
--- a/Tools/peg_generator/pegen/keywordgen.py
+++ b/Tools/peg_generator/pegen/keywordgen.py
@@ -67,8 +67,8 @@ def main():
all_keywords = sorted(list(gen.callmakervisitor.keyword_cache.keys()) + EXTRA_KEYWORDS)
all_soft_keywords = sorted(gen.callmakervisitor.soft_keywords)
- keywords = " " + ",\n ".join(map(repr, all_keywords))
- soft_keywords = " " + ",\n ".join(map(repr, all_soft_keywords))
+ keywords = "" if not all_keywords else " " + ",\n ".join(map(repr, all_keywords))
+ soft_keywords = "" if not all_soft_keywords else " " + ",\n ".join(map(repr, all_soft_keywords))
thefile.write(TEMPLATE.format(keywords=keywords, soft_keywords=soft_keywords))