Commit 9cdacc94 authored by Robert Bradshaw's avatar Robert Bradshaw

Cleanup late includes.

parent fc4bde50
......@@ -138,7 +138,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
env.return_type = PyrexTypes.c_void_type
self.referenced_modules = []
self.find_referenced_modules(env, self.referenced_modules, {})
env.fixup_includes()
self.sort_cdef_classes(env)
self.generate_c_code(env, options, result)
self.generate_h_code(env, options, result)
......@@ -739,7 +738,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if early:
includes += env.include_files_early
if late:
includes += env.include_files_late
includes += [include for include in env.include_files_late
if include not in env.include_files_early]
for filename in includes:
byte_decoded_filenname = str(filename)
......
......@@ -1253,7 +1253,7 @@ class ModuleScope(Scope):
if filename in self.python_include_files:
return
# Possibly, the same include appears both as early and as late
# include. We'll deal with this in fixup_includes().
# include. We'll deal with this at code generation time.
if late:
incs = self.include_files_late
else:
......@@ -1261,13 +1261,6 @@ class ModuleScope(Scope):
if filename not in incs:
incs.append(filename)
def fixup_includes(self):
for filename in self.include_files_early:
try:
self.include_files_late.remove(filename)
except ValueError:
pass
def add_imported_module(self, scope):
if scope not in self.cimported_modules:
for filename in scope.include_files_early:
......
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