]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix trailing whitespace in keyword.py (GH-20881)
authorPablo Galindo <Pablogsal@gmail.com>
Mon, 15 Jun 2020 03:33:33 +0000 (04:33 +0100)
committerGitHub <noreply@github.com>
Mon, 15 Jun 2020 03:33:33 +0000 (04:33 +0100)
Tools/peg_generator/pegen/keywordgen.py

index 639f01bf2373e6a24afd5453e81cb93c778a7207..53638b17e61c6d56a84427e772e51ce8512f184a 100644 (file)
@@ -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))