mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Added Python 3.0 warning to cPickle.
This commit is contained in:
		
							parent
							
								
									ea0b22a167
								
							
						
					
					
						commit
						3c4971c40e
					
				
					 2 changed files with 7 additions and 1 deletions
				
			
		|  | @ -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 | ||||
|  |  | |||
|  | @ -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; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alexandre Vassalotti
						Alexandre Vassalotti