[Tutor] Catching OLE error

Adam Bark adam.jtm30 at gmail.com
Thu Jul 14 16:02:44 CEST 2005


Can you send me the output for an OLE error? The correct syntax should be 
included in the error message like this:

Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

TypeError would be the exception so you would have:

try: None + "foo"
except: TypeError

On 7/14/05, Bernard Lebel <3dbernard at gmail.com> wrote:
> 
> Hello,
> 
> A simple question: what is the syntax in a try/except for the OLE error?
> 
> Let say you want to catch OLE error:
> 
> try: print stuff
> except OLEError: print 'ole'
> 
> Now the problem is that I just can't seem to find anything how the 
> exact grammar of this error! I have looked in the Python
> documentation, as well as the pywin32 documentation, I have tried many
> different ways of typing it, I googled around, but yet I just can't
> find it.
> 
> 
> Thanks
> Bernard
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20050714/8da1dc46/attachment-0001.htm


More information about the Tutor mailing list