]> granicus.if.org Git - python/commitdiff
Record that FCNTL.py has gone away; remove FCNTL hack in tempfile.py;
authorTim Peters <tim.peters@gmail.com>
Sun, 18 Jul 2004 23:58:17 +0000 (23:58 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 18 Jul 2004 23:58:17 +0000 (23:58 +0000)
another hack remains in test___all__.py, but the problem that one
addresses is more general than *just* FCNTL, so leaving it alone.

Lib/tempfile.py
Misc/NEWS

index ef6a1c55d0f6ce4d9978aa17dbf213df07de7db7..ae2ed9e63973aff60aa1f54f53f380a2a20891c0 100644 (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
index 003e3d56805b7a8fb6c4c1f7217e97e7dca3d5da..cd34d13a8bc8f5f9e52930f95124ac2adde441fe 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -34,6 +34,11 @@ Extension modules
 Library
 -------
 
+- The obsolete FCNTL.py has been deleted.  The builtin fcntl module
+  has been available (on platforms that support fcntl) since Python
+  1.5a3, and all FCNTL.py did is export fcntl's names, after generating
+  a deprecation warning telling you to use fcntl directly.
+
 - Several new unicode codecs are added: big5hkscs, euc_jis_2004,
   iso2022_jp_2004, shift_jis_2004.