summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-12-06 22:41:04 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-12-06 22:41:04 (GMT)
commit442f20996dcd994d1024e5cad7f66a4595352eb2 (patch)
tree641746efd4247acd2b5e13f5de7f65c026242a05 /Tools
parent4b237e3b1112304f834ac78fe05abdecbf3d87b4 (diff)
downloadcpython-442f20996dcd994d1024e5cad7f66a4595352eb2.zip
cpython-442f20996dcd994d1024e5cad7f66a4595352eb2.tar.gz
cpython-442f20996dcd994d1024e5cad7f66a4595352eb2.tar.bz2
create NameConstant AST class for None, True, and False literals (closes #16619)
Diffstat (limited to 'Tools')
-rw-r--r--Tools/parser/unparse.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tools/parser/unparse.py b/Tools/parser/unparse.py
index b55e2c6..28b2d5b 100644
--- a/Tools/parser/unparse.py
+++ b/Tools/parser/unparse.py
@@ -307,6 +307,9 @@ class Unparser:
def _Name(self, t):
self.write(t.id)
+ def _NameConstant(self, t):
+ self.write(repr(t.value))
+
def _Num(self, t):
# Substitute overflowing decimal literal for AST infinities.
self.write(repr(t.n).replace("inf", INFSTR))