Commit 296e07f4 authored by Robert Bradshaw's avatar Robert Bradshaw

Correctly look up module of superclass.

parent b20ed8dd
......@@ -4535,7 +4535,10 @@ class CClassDefNode(ClassDefNode):
if self.base_class_name:
if self.base_class_module:
base_class_scope = env.find_module(self.base_class_module, self.pos)
base_class_scope = env.find_imported_module(self.base_class_module.split('.'), self.pos)
if not base_class_scope:
error(self.pos, "'%s' is not a cimported module" % self.base_class_module)
return
else:
base_class_scope = env
if self.base_class_name == 'object':
......
PYTHON setup.py build_ext --inplace
######## setup.py ########
from Cython.Build import cythonize
from Cython.Distutils.extension import Extension
import sys
sys.path.append("path")
ext_modules = [
Extension("importer", ["importer.pyx"]),
]
ext_modules = cythonize(ext_modules, include_path=["include"])
######## pkg/__init__.py ########
######## pkg/a.pxd ########
cdef class A(object):
pass
######## importer.pyx ########
cimport pkg.a
cimport pkg.a as a
cimport pkg.a as a_by_another_name
from pkg cimport a as from_cimported_a
cdef class A1(a.A):
pass
cdef class A2(a_by_another_name.A):
pass
cdef class A3(pkg.a.A):
pass
cdef class A4(from_cimported_a.A):
pass
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