The python experts might weigh in with more details
but, I think "Except:" should catch everything including that
error type.
But I also found this in some test code,
maybe it is the syntax you are looking for?:
# if you try and change the key value when the lock constraint is on it will
# raise an 'Access Denied' error.
try:
fckey.Value = 5
except pythoncom.com_error, (hr, msg, exc, arg):
#intentional failure case
if exc and exc[2]: msg = exc[2]
Assert( msg == "Access denied_$S_2009_$E_", msg )
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf
Of Bernard Lebel
Posted At: Thursday, July 14, 2005 10:12 AM
Posted To: xsi
Conversation: [script] Catching Python's OLE exceptions
Subject: [script] Catching Python's OLE exceptions
Hello list,
Has anyone on this list found a way to catch the pywin32 OLE error?
I have been searching over and over about that, and just can't seem to
find it. I have tried various spellings, search through the Python
library as well as the PythonWin library, and googled around, and
check the ActiveState website, to no avail. I just could not find the
syntax to do that, if possible at all.
Thanks
Bernard
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi