“Python cerrando el bandeo” Código de respuesta

Python cerrando el bandeo

from contextlib import closing

    try:    
        with closing(sock):
           sock.shutdown()
    except OSError:
        pass
Puzzled Puffin

Python cerrando el bandeo

with contextlib.ignore(OSError),\
         closing(sock):
        sock.shutdown()
Puzzled Puffin

Respuestas similares a “Python cerrando el bandeo”

Preguntas similares a “Python cerrando el bandeo”

Más respuestas relacionadas con “Python cerrando el bandeo” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código