Commit b967fd08 authored by Fred Drake's avatar Fred Drake

Fix one more unchecked use of the FCNTL module.

parent ce2e1ee9
......@@ -66,9 +66,13 @@ except:
# processes from Zope code. Thanks to Dieter Maurer for this.
try:
import fcntl, FCNTL
FCNTL.F_SETFD; FCNTL.FD_CLOEXEC
if not (hasattr(fcntl, 'F_SETFD') and hasattr(fcntl, 'FD_CLOEXEC')):
# hack to be compatible with Python versions pre-2.2
import FCNTL
fcntl.F_SETFD = FCNTL.F_SETFD
fcntl.FD_CLOEXEC = FCNTL.FD_CLOEXEC
def requestCloseOnExec(sock):
try: fcntl.fcntl(sock.fileno(), FCNTL.F_SETFD, FCNTL.FD_CLOEXEC)
try: fcntl.fcntl(sock.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)
except: pass
except (ImportError, AttributeError):
......
......@@ -66,9 +66,13 @@ except:
# processes from Zope code. Thanks to Dieter Maurer for this.
try:
import fcntl, FCNTL
FCNTL.F_SETFD; FCNTL.FD_CLOEXEC
if not (hasattr(fcntl, 'F_SETFD') and hasattr(fcntl, 'FD_CLOEXEC')):
# hack to be compatible with Python versions pre-2.2
import FCNTL
fcntl.F_SETFD = FCNTL.F_SETFD
fcntl.FD_CLOEXEC = FCNTL.FD_CLOEXEC
def requestCloseOnExec(sock):
try: fcntl.fcntl(sock.fileno(), FCNTL.F_SETFD, FCNTL.FD_CLOEXEC)
try: fcntl.fcntl(sock.fileno(), fcntl.F_SETFD, fcntl.FD_CLOEXEC)
except: pass
except (ImportError, AttributeError):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment