1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
From 2e774fca5ad55371b21ba2b531d218888319c151 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 18 Aug 2024 17:43:05 -0300
Subject: [PATCH 1/2] Better fix for #6122 to avoid #6535
The change in #6124 introduces a regression with functions that are
implicit noexcept in a pxd file.
---
Cython/Compiler/Nodes.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py
index d4737f7c373..b70d766ed4e 100644
--- a/Cython/Compiler/Nodes.py
+++ b/Cython/Compiler/Nodes.py
@@ -710,10 +710,8 @@ def analyse(self, return_type, env, nonempty=0, directive_locals=None, visibilit
and not self.has_explicit_exc_clause
and self.exception_check
and visibility != 'extern'):
- # If function is already declared from pxd, the exception_check has already correct value.
- if not (self.declared_name() in env.entries and not in_pxd):
- self.exception_check = False
# implicit noexcept, with a warning
+ self.exception_check = False
warning(self.pos,
"Implicit noexcept declaration is deprecated."
" Function declaration should contain 'noexcept' keyword.",
@@ -3128,6 +3126,7 @@ def as_cfunction(self, cfunc=None, scope=None, overridable=True, returns=None, e
if scope is None:
scope = cfunc.scope
cfunc_type = cfunc.type
+ has_explicit_exc_clause=True
if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
error(self.pos, "wrong number of arguments")
error(cfunc.pos, "previous declaration here")
|