mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Py_FatalError: disable faulthandler earlier
Issue #26563: Py_FatalError: disable faulthandler before trying to flush sys.stdout and sys.stderr.
This commit is contained in:
		
							parent
							
								
									861d9abfcf
								
							
						
					
					
						commit
						2025d7839b
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		|  | @ -1371,17 +1371,17 @@ Py_FatalError(const char *msg) | |||
|     if (!_Py_FatalError_PrintExc(fd)) | ||||
|         _Py_FatalError_DumpTracebacks(fd); | ||||
| 
 | ||||
|     /* The main purpose of faulthandler is to display the traceback. We already
 | ||||
|      * did our best to display it. So faulthandler can now be disabled. | ||||
|      * (Don't trigger it on abort().) */ | ||||
|     _PyFaulthandler_Fini(); | ||||
| 
 | ||||
|     /* Check if the current Python thread hold the GIL */ | ||||
|     if (PyThreadState_GET() != NULL) { | ||||
|         /* Flush sys.stdout and sys.stderr */ | ||||
|         flush_std_files(); | ||||
|     } | ||||
| 
 | ||||
|     /* The main purpose of faulthandler is to display the traceback. We already
 | ||||
|      * did our best to display it. So faulthandler can now be disabled. | ||||
|      * (Don't trigger it on abort().) */ | ||||
|     _PyFaulthandler_Fini(); | ||||
| 
 | ||||
| #ifdef MS_WINDOWS | ||||
|     len = strlen(msg); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner