summaryrefslogtreecommitdiff
path: root/Cython/Compiler/Parsing.py
diff options
context:
space:
mode:
authorJelle Zijlstra <jelle.zijlstra@gmail.com>2015-09-12 18:36:22 -0700
committerJelle Zijlstra <jelle.zijlstra@gmail.com>2016-03-20 09:12:44 -0700
commite2a245cb61fd8bf1fd232a53241410e55ef97c01 (patch)
tree1e7e9fbdf6138f9fb340182a1990a9affe2c4bab /Cython/Compiler/Parsing.py
parent1af7483c374496a331f96feabebf3d0b30025815 (diff)
downloadcython-e2a245cb61fd8bf1fd232a53241410e55ef97c01.tar.gz
f-string parsing: fix bugs
Diffstat (limited to 'Cython/Compiler/Parsing.py')
-rw-r--r--Cython/Compiler/Parsing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py
index 74817c8b9..412aec73b 100644
--- a/Cython/Compiler/Parsing.py
+++ b/Cython/Compiler/Parsing.py
@@ -898,7 +898,7 @@ def p_string_literal(s, kind_override=None):
else:
if kind_override is not None and kind_override in 'ub':
kind = kind_override
- if kind in 'uf': # f-strings are scanned exactly like Unicode literals, but are parsed further later
+ if kind in {'u', 'f'}: # f-strings are scanned exactly like Unicode literals, but are parsed further later
chars = StringEncoding.UnicodeLiteralBuilder()
elif kind == '':
chars = StringEncoding.StrLiteralBuilder(s.source_encoding)
@@ -1122,7 +1122,7 @@ def p_f_string_expr(s, unicode_value, pos, starting_index):
# the format spec is itself treated like an f-string
if format_spec_str is not None:
- format_spec = p_f_string(s, format_spec_str, pos)
+ format_spec = ExprNodes.JoinedStrNode(pos, values = p_f_string(s, format_spec_str, pos))
else:
format_spec = None