I try to intercept exceptions in a Python Method without success.

The following code works well:

try:
    a = int('a')
except:
    return 'exception.'

but the next doesn't work:

try:
    a = int('a')
except ValueError:
    return 'exception'

How can I intercept a concrete exception?


_______________________________________________
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )

Reply via email to