Record that FCNTL.py has gone away; remove FCNTL hack in tempfile.py;

another hack remains in test___all__.py, but the problem that one
addresses is more general than *just* FCNTL, so leaving it alone.
This commit is contained in:
Tim Peters 2004-07-18 23:58:17 +00:00
parent 9516609b6b
commit 90ee7eb18e
2 changed files with 10 additions and 7 deletions

View file

@ -38,17 +38,15 @@ if _os.name == 'mac':
try:
import fcntl as _fcntl
# If PYTHONCASEOK is set on Windows, stinking FCNTL.py gets
# imported, and we don't get an ImportError then. Provoke
# an AttributeError instead in that case.
_fcntl.fcntl
except (ImportError, AttributeError):
except ImportError:
def _set_cloexec(fd):
pass
else:
def _set_cloexec(fd):
try: flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
except IOError: pass
try:
flags = _fcntl.fcntl(fd, _fcntl.F_GETFD, 0)
except IOError:
pass
else:
# flags read successfully, modify
flags |= _fcntl.FD_CLOEXEC