summaryrefslogtreecommitdiff
path: root/Parser
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-09-15 06:28:22 +0300
committerBenjamin Peterson <benjamin@python.org>2017-09-14 20:28:22 -0700
commit5d84cb368c0c3e475c25171c302068c4dfc3e396 (patch)
tree1c5748a6ebcf0ed25a91506c4a8310a832a930a5 /Parser
parentb2e5794870eb4728ddfaafc0f79a40299576434f (diff)
downloadcpython-git-5d84cb368c0c3e475c25171c302068c4dfc3e396.tar.gz
bpo-31464: asdl_c.py no longer emits trailing spaces in Python-ast.h. (#3568)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/asdl_c.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index f6c3a66117..a43d2e7b83 100644
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -94,8 +94,9 @@ class EmitVisitor(asdl.VisitorBase):
else:
lines = [s]
for line in lines:
- line = (" " * TABSIZE * depth) + line + "\n"
- self.file.write(line)
+ if line:
+ line = (" " * TABSIZE * depth) + line
+ self.file.write(line + "\n")
class TypeDefVisitor(EmitVisitor):