From: Dag Sverre Seljebotn Date: Thu, 19 Jun 2008 20:58:26 +0000 (-0700) Subject: Now handles the case of pipeline raising exception correctly X-Git-Tag: 0.9.8.1~49^2~111^2~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7308254f9094b4ff4eb6b2e5491d254b9d7d142c;p=cython.git Now handles the case of pipeline raising exception correctly --- diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 445055e9..5c51e632 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -325,15 +325,15 @@ def create_parse(context): return tree return parse -def create_generate_code(context, options): +def create_generate_code(context, options, result): def generate_code(module_node): scope = module_node.scope - result = create_default_resultobj(module_node.compilation_source, options) module_node.process_implementation(options, result) + result.compilation_source = module_node.compilation_source return result return generate_code -def create_default_pipeline(context, options): +def create_default_pipeline(context, options, result): from ParseTreeTransforms import WithTransform, PostParse from ParseTreeTransforms import AnalyseDeclarationsTransform, AnalyseExpressionsTransform from ModuleNode import check_c_classes @@ -345,7 +345,7 @@ def create_default_pipeline(context, options): AnalyseDeclarationsTransform(), check_c_classes, AnalyseExpressionsTransform(), - create_generate_code(context, options) + create_generate_code(context, options, result) ] def create_default_resultobj(compilation_source, options): @@ -380,11 +380,14 @@ def run_pipeline(source, options, full_module_name = None): full_module_name = full_module_name or context.extract_module_name(source, options) source = CompilationSource(source_desc, full_module_name, cwd) + # Set up result object + result = create_default_resultobj(source, options) + # Get pipeline - pipeline = create_default_pipeline(context, options) + pipeline = create_default_pipeline(context, options, result) context.setup_errors(options) - errors_occurred, result = context.run_pipeline(pipeline, source) + errors_occurred, enddata = context.run_pipeline(pipeline, source) context.teardown_errors(errors_occurred, options, result) return result