diff options
| author | shadchin <[email protected]> | 2023-06-18 21:03:32 +0300 |
|---|---|---|
| committer | shadchin <[email protected]> | 2023-06-18 21:03:32 +0300 |
| commit | e0ee27b73eae57d28e6c55ec99ab82371c153eaf (patch) | |
| tree | 93e413bb7b9206f6165c28d6f9dca8c5b57866a7 /contrib/tools/cython/Cython/Compiler/Parsing.py | |
| parent | dc0626c403a73e8cea3729070454814636071bfe (diff) | |
Update Cython to 0.29.35
Diffstat (limited to 'contrib/tools/cython/Cython/Compiler/Parsing.py')
| -rw-r--r-- | contrib/tools/cython/Cython/Compiler/Parsing.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/Parsing.py b/contrib/tools/cython/Cython/Compiler/Parsing.py index 20dbc9bbf95..378a41f0e14 100644 --- a/contrib/tools/cython/Cython/Compiler/Parsing.py +++ b/contrib/tools/cython/Cython/Compiler/Parsing.py @@ -2958,11 +2958,18 @@ def p_exception_value_clause(s): s.next() elif s.sy == '+': exc_check = '+' + plus_char_pos = s.position()[2] s.next() if s.sy == 'IDENT': name = s.systring - s.next() - exc_val = p_name(s, name) + if name == 'nogil': + if s.position()[2] == plus_char_pos + 1: + error(s.position(), + "'except +nogil' defines an exception handling function. Use 'except + nogil' for the 'nogil' modifier.") + # 'except + nogil' is parsed outside + else: + exc_val = p_name(s, name) + s.next() elif s.sy == '*': exc_val = ExprNodes.CharNode(s.position(), value=u'*') s.next() |
