def _cleanupEnvironment():
 if issubclass(urllib2.socket.socket, socks.socksocket):
  socks.unwrapmodule(urllib2)
 if hasattr(socket, '_ready'):
  socket._ready.clear()

def _cleanupEnvironment ( ) : if issubclass ( urllib2 . socket . socket , socks . socksocket ) : socks . unwrapmodule ( urllib2 ) if hasattr ( socket , '_ready' ) : socket . _ready . clear ( )
cleanup environment .