error code

Alex Martelli aleax at aleax.it
Wed Jul 24 11:46:44 EDT 2002


ferreira jorge wrote:

> Hi
> 
> I want to get the code of an error .
> 
> how can I do that ?
> 
> With "sys.exc_value" and "sys.exc_type" I have a String .
> But I want a Integer
> 
> Thanks

Most exceptions have no 'integer' associated with them,
but if you have for example an instance of IOError, it
has an errno attribute that's probably what you want.


Alex




More information about the Python-list mailing list