]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add a new FCNTL.py backward compatibility module that issues a deprecation
authorFred Drake <fdrake@acm.org>
Wed, 9 May 2001 21:13:23 +0000 (21:13 +0000)
committerFred Drake <fdrake@acm.org>
Wed, 9 May 2001 21:13:23 +0000 (21:13 +0000)
warning.  This is similar to the TERMIOS backward compatbility module.

Lib/FCNTL.py [new file with mode: 0644]

diff --git a/Lib/FCNTL.py b/Lib/FCNTL.py
new file mode 100644 (file)
index 0000000..a31a7f8
--- /dev/null
@@ -0,0 +1,14 @@
+"""Backward-compatibility version of FCNTL; export constants exported by
+fcntl, and issue a deprecation warning.
+"""
+
+import warnings
+warnings.warn("the FCNTL module is deprecated; please use fcntl",
+              DeprecationWarning)
+
+
+# Export the constants known to the fcntl module:
+from fcntl import *
+
+# and *only* the constants:
+__all__ = [s for s in dir() if s[0] in "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]