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

antoine.pitrou python-checkins at python.org
Fri Jan 8 20:20:17 CET 2010


Author: antoine.pitrou
Date: Fri Jan  8 20:20:17 2010
New Revision: 77370

Log:
Issue #7092: Remove py3k warning when importing cPickle.  2to3 handles
renaming of `cPickle` to `pickle`.  The warning was annoying since there's
no alternative to cPickle if you care about performance.  Patch by Florent
Xicluna.


Modified:
   python/trunk/Lib/test/test_py3kwarn.py
   python/trunk/Misc/NEWS
   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 Jan  8 20:20:17 2010
@@ -336,7 +336,7 @@
                            'sunos5' : ('sunaudiodev', 'SUNAUDIODEV'),
                           }
     optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev', 'imageop',
-                        'sv', 'cPickle', 'bsddb', 'dbhash')
+                        'sv', 'bsddb', 'dbhash')
 
     def check_removal(self, module_name, optional=False):
         """Make sure the specified module, when imported, raises a

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri Jan  8 20:20:17 2010
@@ -65,6 +65,11 @@
 Library
 -------
 
+- Issue #7092: Remove py3k warning when importing cPickle.  2to3 handles
+  renaming of `cPickle` to `pickle`.  The warning was annoying since there's
+  no alternative to cPickle if you care about performance.  Patch by Florent
+  Xicluna.
+
 - Issue #7455: Fix possible crash in cPickle on invalid input.  Patch by
   Victor Stinner.
 

Modified: python/trunk/Modules/cPickle.c
==============================================================================
--- python/trunk/Modules/cPickle.c	(original)
+++ python/trunk/Modules/cPickle.c	Fri Jan  8 20:20:17 2010
@@ -5973,12 +5973,6 @@
 	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