Commit a7ed57bc authored by Robert Bradshaw's avatar Robert Bradshaw

Fix missing error when overriding final methods of cimported classes.

parent 6e18e71a
...@@ -812,10 +812,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -812,10 +812,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
declaration = method_entry.type.declaration_code( declaration = method_entry.type.declaration_code(
method_entry.final_func_cname) method_entry.final_func_cname)
if method_entry.func_modifiers: if method_entry.func_modifiers:
modifiers = "%s " % ' '.join(method_entry.func_modifiers).upper() modifiers = " %s " % ' '.join(method_entry.func_modifiers).upper()
modifiers = modifiers.replace(" INLINE ", " CYTHON_INLINE ")
else: else:
modifiers = '' modifiers = " "
code.putln("static %s%s;" % (modifiers, declaration)) code.putln("static%s%s;" % (modifiers, declaration))
def generate_objstruct_predeclaration(self, type, code): def generate_objstruct_predeclaration(self, type, code):
if not type.scope: if not type.scope:
......
...@@ -1057,6 +1057,7 @@ class CVarDefNode(StatNode): ...@@ -1057,6 +1057,7 @@ class CVarDefNode(StatNode):
# in_pxd boolean # in_pxd boolean
# api boolean # api boolean
# overridable boolean whether it is a cpdef # overridable boolean whether it is a cpdef
# modifiers ['inline']
# decorators [cython.locals(...)] or None # decorators [cython.locals(...)] or None
# directive_locals { string : NameNode } locals defined by cython.locals(...) # directive_locals { string : NameNode } locals defined by cython.locals(...)
...@@ -1102,7 +1103,7 @@ class CVarDefNode(StatNode): ...@@ -1102,7 +1103,7 @@ class CVarDefNode(StatNode):
if type.is_cfunction: if type.is_cfunction:
self.entry = dest_scope.declare_cfunction(name, type, declarator.pos, self.entry = dest_scope.declare_cfunction(name, type, declarator.pos,
cname = cname, visibility = self.visibility, in_pxd = self.in_pxd, cname = cname, visibility = self.visibility, in_pxd = self.in_pxd,
api = self.api) api = self.api, modifiers = self.modifiers)
if self.entry is not None: if self.entry is not None:
self.entry.is_overridable = self.overridable self.entry.is_overridable = self.overridable
self.entry.directive_locals = copy.copy(self.directive_locals) self.entry.directive_locals = copy.copy(self.directive_locals)
......
...@@ -2736,6 +2736,7 @@ def p_c_func_or_var_declaration(s, pos, ctx): ...@@ -2736,6 +2736,7 @@ def p_c_func_or_var_declaration(s, pos, ctx):
declarators = declarators, declarators = declarators,
in_pxd = ctx.level in ('module_pxd', 'c_class_pxd'), in_pxd = ctx.level in ('module_pxd', 'c_class_pxd'),
api = ctx.api, api = ctx.api,
modifiers = modifiers,
overridable = ctx.overridable) overridable = ctx.overridable)
return result return result
......
...@@ -8,7 +8,7 @@ from distutils.core import setup ...@@ -8,7 +8,7 @@ from distutils.core import setup
from distutils.extension import Extension from distutils.extension import Extension
from Cython.Build import cythonize from Cython.Build import cythonize
ext_modules = cythonize("*.pyx", exclude="numpy_*.pyx") ext_modules = cythonize("**/*.pyx", exclude="numpy_*.pyx")
# Only compile the following if numpy is installed. # Only compile the following if numpy is installed.
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment