fix error handling in sequential cython runs
authorStefan Behnel <scoder@users.berlios.de>
Wed, 24 Nov 2010 18:21:42 +0000 (19:21 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Wed, 24 Nov 2010 18:21:42 +0000 (19:21 +0100)
Cython/Compiler/Errors.py
Cython/Compiler/Main.py

index 0f3031b8e565404e4ad116d05fd658325cb4752d..5e7a6d87b2fc263c8aa5684bd4584be8a565d526 100644 (file)
@@ -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[:]
index 2e283d8d92a0d0ac36bcdeecd2eed1c6eabf2919..fcc1d68f1ce607abe81bdf5be1da9342be81201a 100644 (file)
@@ -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