Sangeeth Saravanaraj added the comment:

I am convinced that the code is wrong. It was written with wrong assumptions. 
But Python 2.7 behaves differently compare to Python 3.4. I am not expecting 
the same behavior in Python 2.7 as in Python 3.4 but I am expecting that some 
form of exception is raised justifying why Condition.notify() is illegal (as 
per #4) in this scenario and not block.

In 3.4, I could see that the signal handler is being called (when hitting 
Ctrl-c) and then Condition.notify() is raising a RuntimeError. But in 2.7, I am 
not able to prove that the signal handler is called at all. That makes me think 
why the signal is not caught when control is in Condition.wait().  

Your updated code snippet behaves the same as my original code. It blocks at 
Condition.wait() and does not respond to Ctrl-C and no signal handler is called 
and also not raising any exceptions.

Thanks for the beautiful explanation!

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21913>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to