type(socket) != SocketType

Irmen de Jong irmen at NOSPAMREMOVETHISxs4all.nl
Sat Jun 15 17:37:33 EDT 2002


Chris Liechti wrote in a prompt response:

> what happens to people with timoutsocket? that module repaces the 
> socket.socket class with a custom one and your check will fail....

Heh, you're probably right. I hereby declare socket.SocketType useless.

> maybe there is a cleverer solution that typechecking. the SSL socket has 
> other/additional attributes etc right?. check for them with has_attr(). or 
> use the __name__ attribute of the class.

Thanks for these suggestions. I will probably go check for the 'pending'
attribute, because that is what the SSL sockets have and regular sockets
don't. This will likely fix things....

Irmen.





More information about the Python-list mailing list