summaryrefslogtreecommitdiff
path: root/as_string.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2013-12-27 12:35:34 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2013-12-27 12:35:34 +0200
commite6c7c322d96f63911da3ced497aadaf9968852c7 (patch)
tree8a5a95859d3934b6089d3319582daa8ffddd45f4 /as_string.py
parent46cf84884626d8e960d53ea74f2e3aac2f603122 (diff)
downloadastroid-git-e6c7c322d96f63911da3ced497aadaf9968852c7.tar.gz
Fix `as_string` for one element tuples.
Diffstat (limited to 'as_string.py')
-rw-r--r--as_string.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/as_string.py b/as_string.py
index b7e62571..72c5b6c3 100644
--- a/as_string.py
+++ b/as_string.py
@@ -399,6 +399,8 @@ class AsStringVisitor(object):
def visit_tuple(self, node):
"""return an astroid.Tuple node as string"""
+ if len(node.elts) == 1:
+ return '(%s, )' % node.elts[0].accept(self)
return '(%s)' % ', '.join([child.accept(self) for child in node.elts])
def visit_unaryop(self, node):