From fdae4c23bd8a3599896426187b244b525ba8e74b Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Sat, 10 Nov 2007 20:13:45 -0800 Subject: [PATCH] Fix agreement of cpdef functions and pxd files --- Cython/Compiler/Nodes.py | 2 +- Cython/Compiler/Parsing.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 70d3b214..a254b657 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -351,7 +351,7 @@ class CFuncDeclaratorNode(CDeclaratorNode): return_type, func_type_args, self.has_varargs, exception_value = exc_val, exception_check = exc_check, calling_convention = self.base.calling_convention, - nogil = self.nogil, with_gil = self.with_gil) + nogil = self.nogil, with_gil = self.with_gil, is_overridable = self.overridable) return self.base.analyse(func_type, env) diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index bd4b0eb7..47f8c475 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -1300,7 +1300,7 @@ def p_statement(s, level, cdef_flag = 0, visibility = 'private', api = 0): if level not in ('module', 'module_pxd'): s.error("ctypedef statement not allowed here") if api: - error(s.pos, "'api' not allowed with 'ctypedef'") + error(s.position(), "'api' not allowed with 'ctypedef'") return p_ctypedef_statement(s, level, visibility, api) elif s.sy == 'DEF': return p_DEF_statement(s) @@ -1859,6 +1859,7 @@ def p_c_func_or_var_declaration(s, level, pos, visibility = 'private', api = 0, modifiers = p_c_modifiers(s) base_type = p_c_base_type(s) declarator = p_c_declarator(s, cmethod_flag = cmethod_flag, assignable = 1, nonempty = 1) + declarator.overridable = overridable if s.sy == ':': if level not in ('module', 'c_class'): s.error("C function definition not allowed here") @@ -1888,7 +1889,8 @@ def p_c_func_or_var_declaration(s, level, pos, visibility = 'private', api = 0, base_type = base_type, declarators = declarators, in_pxd = level == 'module_pxd', - api = api) + api = api, + overridable = overridable) return result def p_ctypedef_statement(s, level, visibility = 'private', api = 0): -- 2.26.2