summaryrefslogtreecommitdiffstats
path: root/Parser/asdl_c.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-09-15 03:28:22 (GMT)
committerBenjamin Peterson <benjamin@python.org>2017-09-15 03:28:22 (GMT)
commit5d84cb368c0c3e475c25171c302068c4dfc3e396 (patch)
tree1c5748a6ebcf0ed25a91506c4a8310a832a930a5 /Parser/asdl_c.py
parentb2e5794870eb4728ddfaafc0f79a40299576434f (diff)
downloadcpython-5d84cb368c0c3e475c25171c302068c4dfc3e396.zip
cpython-5d84cb368c0c3e475c25171c302068c4dfc3e396.tar.gz
cpython-5d84cb368c0c3e475c25171c302068c4dfc3e396.tar.bz2
bpo-31464: asdl_c.py no longer emits trailing spaces in Python-ast.h. (#3568)
Diffstat (limited to 'Parser/asdl_c.py')
-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 f6c3a66..a43d2e7 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):