mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-44441: _PyImport_Fini2() resets PyImport_Inittab (GH-26874) (GH-26878)
Py_RunMain() now resets PyImport_Inittab to its initial value at
exit. It must be possible to call PyImport_AppendInittab() or
PyImport_ExtendInittab() at each Python initialization.
(cherry picked from commit 489699ca05)
			
			
This commit is contained in:
		
							parent
							
								
									fcde2c6a8c
								
							
						
					
					
						commit
						5ed7827b16
					
				
					 6 changed files with 88 additions and 10 deletions
				
			
		|  | @ -296,6 +296,9 @@ _PyImport_Fini2(void) | |||
|     PyMemAllocatorEx old_alloc; | ||||
|     _PyMem_SetDefaultAllocator(PYMEM_DOMAIN_RAW, &old_alloc); | ||||
| 
 | ||||
|     // Reset PyImport_Inittab
 | ||||
|     PyImport_Inittab = _PyImport_Inittab; | ||||
| 
 | ||||
|     /* Free memory allocated by PyImport_ExtendInittab() */ | ||||
|     PyMem_RawFree(inittab_copy); | ||||
|     inittab_copy = NULL; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner