mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Get the line number from PyCode_Addr2Line instead of believing
tb_lineno. Store it in tb_lineno for the user.
This commit is contained in:
		
							parent
							
								
									747596a491
								
							
						
					
					
						commit
						b3f515af64
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -243,11 +243,14 @@ tb_printinternal(tb, f, limit) | |||
| 		tb1 = tb1->tb_next; | ||||
| 	} | ||||
| 	while (tb != NULL && !intrcheck()) { | ||||
| 		if (depth <= limit) | ||||
| 		if (depth <= limit) { | ||||
| 			tb->tb_lineno = PyCode_Addr2Line(tb->tb_frame->f_code, | ||||
| 							 tb->tb_lasti); | ||||
| 			tb_displayline(f, | ||||
| 			    getstringvalue(tb->tb_frame->f_code->co_filename), | ||||
| 			    tb->tb_lineno, | ||||
| 			    getstringvalue(tb->tb_frame->f_code->co_name)); | ||||
| 		} | ||||
| 		depth--; | ||||
| 		tb = tb->tb_next; | ||||
| 	} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum