[Tutor] Catching OLE error
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"
On 7/14/05, Bernard Lebel <3dbernard at gmail.com> wrote:
> 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.
> Tutor maillist - Tutor at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor