]> granicus.if.org Git - python/commitdiff
Added Python 3.0 warning to cPickle.
authorAlexandre Vassalotti <alexandre@peadrop.com>
Fri, 16 May 2008 19:14:31 +0000 (19:14 +0000)
committerAlexandre Vassalotti <alexandre@peadrop.com>
Fri, 16 May 2008 19:14:31 +0000 (19:14 +0000)
Lib/test/test_py3kwarn.py
Modules/cPickle.c

index c6160dac97c31ccce283dc6f9c6f39a1345d60e4..2c8f509e605b0b92f755b27c73d641af8cee34f8 100644 (file)
@@ -155,7 +155,7 @@ class TestStdlibRemovals(unittest.TestCase):
                            'sunos5' : ('sunaudiodev', 'SUNAUDIODEV'),
                           }
     optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev', 'imageop',
-                        'sv')
+                        'sv', 'cPickle')
 
     def check_removal(self, module_name, optional=False):
         """Make sure the specified module, when imported, raises a
index 1dd35be645d8bb057e1967e0a15a963c4a4c3e97..06726eed9c57e138ad90fc44047d63060311266c 100644 (file)
@@ -5710,6 +5710,12 @@ initcPickle(void)
        PyObject *format_version;
        PyObject *compatible_formats;
 
+       /* XXX: Should mention that the pickle module will include the C
+          XXX: optimized implementation automatically. */
+       if (PyErr_WarnPy3k("the cPickle module has been removed in "
+                          "Python 3.0", 2) < 0)
+               return;
+
        Py_TYPE(&Picklertype) = &PyType_Type;
        Py_TYPE(&Unpicklertype) = &PyType_Type;
        Py_TYPE(&PdataType) = &PyType_Type;