Commit 3508b9e9 authored by Stefan Behnel's avatar Stefan Behnel

fix undefined variable 'context' in compile_multiple()

parent a7c689c1
...@@ -384,10 +384,11 @@ def create_default_resultobj(compilation_source, options): ...@@ -384,10 +384,11 @@ def create_default_resultobj(compilation_source, options):
result.c_file = Utils.replace_suffix(source_desc.filename, c_suffix) result.c_file = Utils.replace_suffix(source_desc.filename, c_suffix)
return result return result
def run_pipeline(source, options, full_module_name = None): def run_pipeline(source, options, full_module_name=None, context=None):
import Pipeline import Pipeline
context = options.create_context() if context is None:
context = options.create_context()
# Set up source object # Set up source object
cwd = os.getcwd() cwd = os.getcwd()
...@@ -551,16 +552,20 @@ def compile_multiple(sources, options): ...@@ -551,16 +552,20 @@ def compile_multiple(sources, options):
if timestamps is None: if timestamps is None:
timestamps = recursive timestamps = recursive
verbose = options.verbose or ((recursive or timestamps) and not options.quiet) verbose = options.verbose or ((recursive or timestamps) and not options.quiet)
context = None
for source in sources: for source in sources:
if source not in processed: if source not in processed:
# Compiling multiple sources in one context doesn't quite if context is None:
# work properly yet. context = options.create_context()
if not timestamps or context.c_file_out_of_date(source): if not timestamps or context.c_file_out_of_date(source):
if verbose: if verbose:
sys.stderr.write("Compiling %s\n" % source) sys.stderr.write("Compiling %s\n" % source)
result = run_pipeline(source, options) result = run_pipeline(source, options, context=context)
results.add(source, result) results.add(source, result)
# Compiling multiple sources in one context doesn't quite
# work properly yet.
context = None
processed.add(source) processed.add(source)
if recursive: if recursive:
for module_name in context.find_cimported_module_names(source): for module_name in context.find_cimported_module_names(source):
......
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