]> granicus.if.org Git - python/commitdiff
Deprecate the dl module for removal in 3.0.
authorBrett Cannon <bcannon@gmail.com>
Sat, 10 May 2008 21:20:19 +0000 (21:20 +0000)
committerBrett Cannon <bcannon@gmail.com>
Sat, 10 May 2008 21:20:19 +0000 (21:20 +0000)
Doc/library/dl.rst
Lib/test/test_dl.py
Lib/test/test_py3kwarn.py
Modules/dlmodule.c

index de641e3c623d2bdfce0f0ad8c1a230eec2b66829..557812048c5fd37196cec45b9fe952968fcafe03 100644 (file)
@@ -5,6 +5,11 @@
 .. module:: dl
    :platform: Unix
    :synopsis: Call C functions in shared objects.
+   :deprecated:
+   
+.. deprecated:: 2.6
+    The dl module has been removed in Python 3.0.
+   
 .. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
 
 The :mod:`dl` module defines an interface to the :cfunc:`dlopen` function, which
index a2e4460d13ead4e20d84838968dc309b5dbf62ff..c04bc1b530055276933684899bcd1a14114cb310 100755 (executable)
@@ -2,9 +2,8 @@
 """Test dlmodule.c
    Roger E. Masse  revised strategy by Barry Warsaw
 """
-
-import dl
-from test.test_support import verbose,TestSkipped
+from test.test_support import verbose,TestSkipped, import_module
+dl = import_module('dl', deprecated=True)
 
 sharedlibs = [
     ('/usr/lib/libc.so', 'getpid'),
index 991d5cf9e4d9a03815f544f3ede085b1a2c3f25e..30f1668f5faa46bf98b7c3f67bb90ea80a2caaa9 100644 (file)
@@ -132,7 +132,7 @@ class TestStdlibRemovals(unittest.TestCase):
                         'Bastion', 'compiler', 'dircache')
     inclusive_platforms = {'irix':('pure',)}
     # XXX Don't know if lib-tk is only installed if _tkinter is built.
-    optional_modules = ('bsddb185', 'Canvas')
+    optional_modules = ('bsddb185', 'Canvas', 'dl')
 
     def check_removal(self, module_name, optional=False):
         """Make sure the specified module, when imported, raises a
index 2b50ed63ab1dfefa1132373ab0543c41c3b928bb..112e6350e29484db0acd66ff344dea3acfb81f49 100644 (file)
@@ -235,6 +235,10 @@ initdl(void)
 {
        PyObject *m, *d, *x;
 
+    if (PyErr_WarnPy3k("the dl module has been removed in "
+                       "Python 3.0", 2) < 0)
+        return;    
+
        /* Initialize object type */
        Py_TYPE(&Dltype) = &PyType_Type;