summaryrefslogtreecommitdiff
path: root/Tools/parser/unparse.py
diff options
context:
space:
mode:
authorChih-Hsuan Yen <yan12125@gmail.com>2019-05-27 01:08:20 +0800
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-05-26 10:08:19 -0700
commitaaf47caf35984e614d93bd8bea5227df55e0e3e6 (patch)
tree14f42690fe8234b67dac4ced92dbaff183865375 /Tools/parser/unparse.py
parent91f4380cedbae32b49adbea2518014a5624c6523 (diff)
downloadcpython-git-aaf47caf35984e614d93bd8bea5227df55e0e3e6.tar.gz
bpo-37053: handle strings like u"bar" correctly in Tools/parser/unparse.py (GH-13583)
Constant.kind is added in https://bugs.python.org/issue36280. Current possible values for Constant.kind are "u" or None. For r'bar' and b'bar', Constant.kind value is None, so there's no need for special handling. https://bugs.python.org/issue37053
Diffstat (limited to 'Tools/parser/unparse.py')
-rw-r--r--Tools/parser/unparse.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Tools/parser/unparse.py b/Tools/parser/unparse.py
index 385902ef4b..a5cc000676 100644
--- a/Tools/parser/unparse.py
+++ b/Tools/parser/unparse.py
@@ -399,6 +399,8 @@ class Unparser:
elif value is ...:
self.write("...")
else:
+ if t.kind == "u":
+ self.write("u")
self._write_constant(t.value)
def _List(self, t):