From 9c81e19edfc2db7f4055b5716da145ad381ec38f Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Fri, 24 Mar 2023 03:03:35 -0400 Subject: Do not attempt to write out a depfile on failure (GH-5291) This would be pretty useless as it cannot be used -- the output file does not exist either. But as it happens, on error, the output file is reset to None, so instead we triggered a python traceback while trying to write a depfile for `os.path.relpath(None, cwd)` that was written to `None+'.dep'` --- Cython/Compiler/Main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 9c57452ba..561ac222d 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -514,7 +514,7 @@ def run_pipeline(source, options, full_module_name=None, context=None): context.setup_errors(options, result) err, enddata = Pipeline.run_pipeline(pipeline, source) context.teardown_errors(err, options, result) - if options.depfile: + if err is None and options.depfile: from ..Build.Dependencies import create_dependency_tree dependencies = create_dependency_tree(context).all_dependencies(result.main_source_file) Utils.write_depfile(result.c_file, result.main_source_file, dependencies) -- cgit v1.2.1