socket.error.__bases__ = (EnvironmentError,) ?

robert no-spam at no-spam-no-spam.invalid
Sun Nov 5 18:39:59 CET 2006

I've often trouble catching IO errors in general. Now a frequent case everywhere in an app after I've added a defaultsockettimout.
Is this a legal/right practice to change the Exception tree like this:

socket.error.__bases__ = (EnvironmentError,)

And is there a chance that in future there is a common base exception class (EnvironmentError or an new super class) for these kind of exceptions (socket, httplib, ftplib, ...)


More information about the Python-list mailing list