Answer the question
In order to leave comments, you need to log in
Why is the exception not shown?
There is a wrapper class in the code for the page control object. When working with an object through with statement, no exceptions are thrown. Those .. if there is an error somewhere in the method, then the program simply exits the block. Why is that?
Answer the question
In order to leave comments, you need to log in
In general, I solved the problem by realizing that exceptions inside the block are passed to the magic __exit__ method , approx.
def __exit__(self, exc_type, exc_value, exc_traceback):
where you can then either handle the exception or pass it above.
Apparently the context manager, located in the statement, swallows exceptions. It is impossible to say anything more precisely on the current formulation of the question.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question