summaryrefslogtreecommitdiff
path: root/Tools/parser/unparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/parser/unparse.py')
-rw-r--r--Tools/parser/unparse.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/Tools/parser/unparse.py b/Tools/parser/unparse.py
index b55e2c6235..837cd81aaf 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))
@@ -515,10 +518,10 @@ class Unparser:
else: self.write(", ")
self.write("*")
if t.vararg:
- self.write(t.vararg)
- if t.varargannotation:
+ self.write(t.vararg.arg)
+ if t.vararg.annotation:
self.write(": ")
- self.dispatch(t.varargannotation)
+ self.dispatch(t.vararg.annotation)
# keyword-only arguments
if t.kwonlyargs:
@@ -534,10 +537,10 @@ class Unparser:
if t.kwarg:
if first:first = False
else: self.write(", ")
- self.write("**"+t.kwarg)
- if t.kwargannotation:
+ self.write("**"+t.kwarg.arg)
+ if t.kwarg.annotation:
self.write(": ")
- self.dispatch(t.kwargannotation)
+ self.dispatch(t.kwarg.annotation)
def _keyword(self, t):
self.write(t.arg)