Any way to turn off exception handling? (debugging)

mk mrkafk at gmail.com
Thu Feb 11 14:12:23 EST 2010


Peter Otten wrote:

> try: 
>    ...
> except socket.error: 
>    ...
> 
> #untested
> import socket
> 
> class SocketWrapper:
>     def __getattr__(self, name):
>         return getattr(socket, name)
>     error = None
> 
> import module_using_socket
> module_using_socket.socket = SocketWrapper()

Very interesting solution. Thanks!

Regards,
mk







More information about the Python-list mailing list