From bc9cdf449a03363a49041a2e7a02e94e346589c3 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 24 Nov 2010 19:21:42 +0100 Subject: [PATCH] fix error handling in sequential cython runs --- Cython/Compiler/Errors.py | 8 ++++++++ Cython/Compiler/Main.py | 1 + 2 files changed, 9 insertions(+) diff --git a/Cython/Compiler/Errors.py b/Cython/Compiler/Errors.py index 0f3031b8..5e7a6d87 100644 --- a/Cython/Compiler/Errors.py +++ b/Cython/Compiler/Errors.py @@ -201,3 +201,11 @@ def release_errors(ignore=False): def held_errors(): return error_stack[-1] + + +# this module needs a redesign to support parallel cythonisation, but +# for now, the following works at least in sequential compiler runs + +def reset(): + _warn_once_seen.clear() + del error_stack[:] diff --git a/Cython/Compiler/Main.py b/Cython/Compiler/Main.py index 2e283d8d..fcc1d68f 100644 --- a/Cython/Compiler/Main.py +++ b/Cython/Compiler/Main.py @@ -510,6 +510,7 @@ class Context(object): return ".".join(names) def setup_errors(self, options, result): + Errors.reset() # clear any remaining error state if options.use_listing_file: result.listing_file = Utils.replace_suffix(source, ".lis") path = result.listing_file -- 2.26.2