Commit 2c748f0e authored by Robert Bradshaw's avatar Robert Bradshaw

Test for ticket #4, from package cimport module, finish fixing ticket.

parent 7176077c
......@@ -4688,8 +4688,12 @@ class FromCImportStatNode(StatNode):
entry = module_scope.declare_c_class(name, pos = pos,
module_name = self.module_name)
else:
error(pos, "Name '%s' not declared in module '%s'"
% (name, self.module_name))
submodule_scope = env.context.find_module(name, relative_to = module_scope, pos = self.pos)
if submodule_scope.parent_module is module_scope:
env.declare_module(as_name or name, submodule_scope, self.pos)
else:
error(pos, "Name '%s' not declared in module '%s'"
% (name, self.module_name))
if entry:
local_name = as_name or name
......
cdef int **foo(void*)
from a cimport b
cdef int **t = b.foo(NULL)
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