[issue7523] add SOCK_NONBLOCK and SOCK_CLOEXEC to socket module

lekma report at bugs.python.org
Fri Dec 18 08:53:01 CET 2009


lekma <lekmalek at gmail.com> added the comment:

> - when importing fcntl, bear in mind that some systems don't have this
> module (e.g. Windows), so you should catch and silence the ImportError

would something like the following be ok?:

try:
    import fcntl
except ImportError:
    fcntl = False

and then:

if hasattr(socket, "SOCK_CLOEXEC") and fcntl:
    tests.append(CloexecLinuxConstantTest)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7523>
_______________________________________


More information about the Python-bugs-list mailing list