mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	bpo-44472: Fix ltrace functionality when exceptions are raised (GH-26822)
This commit is contained in:
		
							parent
							
								
									30f7a77f35
								
							
						
					
					
						commit
						06cda808f1
					
				
					 2 changed files with 4 additions and 0 deletions
				
			
		|  | @ -0,0 +1 @@ | ||||||
|  | Fix ltrace functionality when exceptions are raised. Patch by Pablo Galindo | ||||||
|  | @ -5325,11 +5325,14 @@ static int | ||||||
| prtrace(PyThreadState *tstate, PyObject *v, const char *str) | prtrace(PyThreadState *tstate, PyObject *v, const char *str) | ||||||
| { | { | ||||||
|     printf("%s ", str); |     printf("%s ", str); | ||||||
|  |     PyObject *type, *value, *traceback; | ||||||
|  |     PyErr_Fetch(&type, &value, &traceback); | ||||||
|     if (PyObject_Print(v, stdout, 0) != 0) { |     if (PyObject_Print(v, stdout, 0) != 0) { | ||||||
|         /* Don't know what else to do */ |         /* Don't know what else to do */ | ||||||
|         _PyErr_Clear(tstate); |         _PyErr_Clear(tstate); | ||||||
|     } |     } | ||||||
|     printf("\n"); |     printf("\n"); | ||||||
|  |     PyErr_Restore(type, value, traceback); | ||||||
|     return 1; |     return 1; | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Pablo Galindo
						Pablo Galindo