win32com: Setting ByRef parameters in an event

Paul Moore paul.moore at uk.origin-it.com
Fri Aug 24 11:00:57 EDT 2001


On Fri, 17 Aug 2001 01:32:46 +0200, Mark Hammond <MarkH at ActiveState.com>
wrote:

>>> (And, BTW, if I hit Ctrl-C, I get an error
>>>"Unhandled exception detected before entering Python." - shouldn't I
>>> get a KeybordInterrupt error?)
>
>Well, the Ctrl+C key is being hit _before_ Python code is entered.  In 
>this case we possibly do _not_ want Python to handle the exception - for 
>all we know, the object itself has handled the Ctrl+C key, and is 
>calling back into Python to handle it.

Hmm, thinking some more about this, the key point is that we don't *know* that
the object has handled the exception. But if the object does handle the
exception, surely the Python support code won't see it (it'll have already
been translated into an OnCtrlC event or whatever, and handled). So the only
time Python sees the Ctrl-C is when the object *hasn't* handled it - and so
Python *should* handle it. After all, in the current situation, where the
object does not handle Ctrl-C, I have no way of either handling it on the next
event in Python, nor of suppressing the message.

Sorry, the above paragraph is a bit muddled - I'm not sure I understand all
the issues here. But I don't think that a simple "it's the component's fault"
answers all of the questions.

Paul.




More information about the Python-list mailing list