mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-46008: Add _PyInterpreterState_Main(). (gh-29978)
PyInterpreterState_Main() is a plain function exposed in the public C-API. For internal usage we can take the more efficient approach in this PR. https://bugs.python.org/issue46008
This commit is contained in:
		
							parent
							
								
									1f384e3184
								
							
						
					
					
						commit
						758b74e71e
					
				
					 4 changed files with 13 additions and 9 deletions
				
			
		|  | @ -1953,7 +1953,7 @@ new_interpreter(PyThreadState **tstate_p, int isolated_subinterpreter) | |||
| #endif | ||||
|     { | ||||
|         /* No current thread state, copy from the main interpreter */ | ||||
|         PyInterpreterState *main_interp = PyInterpreterState_Main(); | ||||
|         PyInterpreterState *main_interp = _PyInterpreterState_Main(); | ||||
|         config = _PyInterpreterState_GetConfig(main_interp); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -1204,7 +1204,7 @@ PyInterpreterState_Head(void) | |||
| PyInterpreterState * | ||||
| PyInterpreterState_Main(void) | ||||
| { | ||||
|     return _PyRuntime.interpreters.main; | ||||
|     return _PyInterpreterState_Main(); | ||||
| } | ||||
| 
 | ||||
| PyInterpreterState * | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Eric Snow
						Eric Snow