[Python-checkins] r63392 - in python/trunk: Lib/test/test_py3kwarn.py Modules/cPickle.c

alexandre.vassalotti python-checkins at python.org
Fri May 16 21:14:38 CEST 2008


Author: alexandre.vassalotti
Date: Fri May 16 21:14:31 2008
New Revision: 63392

Log:
Added Python 3.0 warning to cPickle.


Modified:
   python/trunk/Lib/test/test_py3kwarn.py
   python/trunk/Modules/cPickle.c

Modified: python/trunk/Lib/test/test_py3kwarn.py
==============================================================================
--- python/trunk/Lib/test/test_py3kwarn.py	(original)
+++ python/trunk/Lib/test/test_py3kwarn.py	Fri May 16 21:14:31 2008
@@ -155,7 +155,7 @@
                            '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

Modified: python/trunk/Modules/cPickle.c
==============================================================================
--- python/trunk/Modules/cPickle.c	(original)
+++ python/trunk/Modules/cPickle.c	Fri May 16 21:14:31 2008
@@ -5710,6 +5710,12 @@
 	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;


More information about the Python-checkins mailing list