Commit 58382606 authored by Robert Bradshaw's avatar Robert Bradshaw

import from pyx working

parent c7476b5c
......@@ -249,11 +249,13 @@ class Context(object):
FlattenInListTransform,
WithTransform,
]:
pass # continue
continue
pipeline.append(stage)
if isinstance(stage, AnalyseDeclarationsTransform):
break
def fake_pxd(root):
for entry in root.scope.entries.values():
entry.defined_in_pxd = 1
return StatListNode(root.pos, stats=[]), root.scope
pipeline.append(fake_pxd)
return pipeline
......@@ -605,7 +607,9 @@ def create_parse(context):
source_desc = compsrc.source_desc
full_module_name = compsrc.full_module_name
initial_pos = (source_desc, 1, 0)
saved_cimport_from_pyx, Options.cimport_from_pyx = Options.cimport_from_pyx, False
scope = context.find_module(full_module_name, pos = initial_pos, need_pxd = 0)
Options.cimport_from_pyx = saved_cimport_from_pyx
tree = context.parse(source_desc, scope, pxd = 0, full_module_name = full_module_name)
tree.compilation_source = compsrc
tree.scope = scope
......
......@@ -2115,7 +2115,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# Generate code to create PyCFunction wrappers for exported C functions.
entries = []
for entry in env.var_entries:
if entry.api or entry.defined_in_pxd:
if entry.api or entry.defined_in_pxd or Options.cimport_from_pyx:
entries.append(entry)
if entries:
env.use_utility_code(voidptr_export_utility_code)
......@@ -2129,7 +2129,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
# Generate code to create PyCFunction wrappers for exported C functions.
entries = []
for entry in env.cfunc_entries:
if entry.api or entry.defined_in_pxd:
if entry.api or entry.defined_in_pxd or Options.cimport_from_pyx:
entries.append(entry)
if entries:
env.use_utility_code(function_export_utility_code)
......
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