[Python-checkins] r62971 - in python/trunk: Doc/library/bsddb.rst Lib/test/test_bsddb185.py Lib/test/test_py3kwarn.py Misc/NEWS Modules/bsddbmodule.c

brett.cannon python-checkins at python.org
Sat May 10 04:47:54 CEST 2008


Author: brett.cannon
Date: Sat May 10 04:47:54 2008
New Revision: 62971

Log:
Deprecate the bsddb185 module for removal in 3.0.


Modified:
   python/trunk/Doc/library/bsddb.rst
   python/trunk/Lib/test/test_bsddb185.py
   python/trunk/Lib/test/test_py3kwarn.py
   python/trunk/Misc/NEWS
   python/trunk/Modules/bsddbmodule.c

Modified: python/trunk/Doc/library/bsddb.rst
==============================================================================
--- python/trunk/Doc/library/bsddb.rst	(original)
+++ python/trunk/Doc/library/bsddb.rst	Sat May 10 04:47:54 2008
@@ -82,7 +82,8 @@
    Beginning in 2.3 some Unix versions of Python may have a :mod:`bsddb185` module.
    This is present *only* to allow backwards compatibility with systems which ship
    with the old Berkeley DB 1.85 database library.  The :mod:`bsddb185` module
-   should never be used directly in new code.
+   should never be used directly in new code. The module has been removed in
+   Python 3.0.
 
 
 .. seealso::

Modified: python/trunk/Lib/test/test_bsddb185.py
==============================================================================
--- python/trunk/Lib/test/test_bsddb185.py	(original)
+++ python/trunk/Lib/test/test_bsddb185.py	Sat May 10 04:47:54 2008
@@ -4,9 +4,9 @@
 testing suite.
 
 """
-from test.test_support import run_unittest, findfile
+from test.test_support import run_unittest, findfile, import_module
 import unittest
-import bsddb185
+bsddb185 = import_module('bsddb185', deprecated=True)
 import anydbm
 import whichdb
 import os

Modified: python/trunk/Lib/test/test_py3kwarn.py
==============================================================================
--- python/trunk/Lib/test/test_py3kwarn.py	(original)
+++ python/trunk/Lib/test/test_py3kwarn.py	Sat May 10 04:47:54 2008
@@ -131,6 +131,7 @@
     all_platforms = ('audiodev', 'imputil', 'mutex', 'user', 'new', 'rexec',
                         'Bastion')
     inclusive_platforms = {'irix':('pure',)}
+    optional_modules = ('bsddb185',)
 
     def check_removal(self, module_name, optional=False):
         """Make sure the specified module, when imported, raises a
@@ -169,6 +170,11 @@
         for module_name in self.inclusive_platforms.get(sys.platform, []):
             self.check_removal(module_name, optional=True)
 
+    def test_optional_module_removals(self):
+        # Test the removal of modules that may or may not be built.
+        for module_name in self.optional_modules:
+            self.check_removal(module_name, optional=True)
+
     def test_os_path_walk(self):
         msg = "In 3.x, os.path.walk is removed in favor of os.walk."
         def dumbo(where, names, args): pass

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Sat May 10 04:47:54 2008
@@ -23,6 +23,8 @@
 Library
 -------
 
+- The bsddb185 module has been deprecated for removal in Python 3.0.
+
 - The pure module has been deprecated for removal in Python 3.0.
 
 - Issue #2487: change the semantics of math.ldexp(x, n) when n is too

Modified: python/trunk/Modules/bsddbmodule.c
==============================================================================
--- python/trunk/Modules/bsddbmodule.c	(original)
+++ python/trunk/Modules/bsddbmodule.c	Sat May 10 04:47:54 2008
@@ -847,6 +847,10 @@
 initbsddb185(void) {
 	PyObject *m, *d;
 
+    if (PyErr_WarnPy3k("the bsddb185 module has been removed in "
+                       "Python 3.0", 2) < 0)
+        return;    
+
 	Bsddbtype.ob_type = &PyType_Type;
 	m = Py_InitModule("bsddb185", bsddbmodule_methods);
 	if (m == NULL)


More information about the Python-checkins mailing list