summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/common
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/common')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/common/exception.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/common/exception.py b/tosca2heat/tosca-parser/toscaparser/common/exception.py
index 67a9f7f..d36a714 100644
--- a/tosca2heat/tosca-parser/toscaparser/common/exception.py
+++ b/tosca2heat/tosca-parser/toscaparser/common/exception.py
@@ -207,10 +207,14 @@ class ExceptionCollector(object):
@staticmethod
def removeException(exception_type):
- if ExceptionCollector.collecting and ExceptionCollector.exceptions:
+ # if ExceptionCollector.collecting and ExceptionCollector.exceptions:
+ if ExceptionCollector.exceptions:
+ tmp_exceptions = []
for i, e in enumerate(ExceptionCollector.exceptions):
- if isinstance(e, exception_type):
- del ExceptionCollector.exceptions[i]
+ if not isinstance(e, exception_type):
+ tmp_exceptions.append(e)
+ # del ExceptionCollector.exceptions[i]
+ ExceptionCollector.exceptions = tmp_exceptions
@staticmethod
def exceptionsCaught():