diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2015-09-12 18:36:22 -0700 |
---|---|---|
committer | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2016-03-20 09:12:44 -0700 |
commit | e2a245cb61fd8bf1fd232a53241410e55ef97c01 (patch) | |
tree | 1e7e9fbdf6138f9fb340182a1990a9affe2c4bab /Cython/Compiler/Parsing.py | |
parent | 1af7483c374496a331f96feabebf3d0b30025815 (diff) | |
download | cython-e2a245cb61fd8bf1fd232a53241410e55ef97c01.tar.gz |
f-string parsing: fix bugs
Diffstat (limited to 'Cython/Compiler/Parsing.py')
-rw-r--r-- | Cython/Compiler/Parsing.py | 4 |
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 |