mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Only use PyCode_Addr2Line to get tb_lineno when Py_OptimizeFlag is set.
This commit is contained in:
		
							parent
							
								
									d3d6f8ffad
								
							
						
					
					
						commit
						73237c54b4
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -243,8 +243,9 @@ tb_printinternal(tb, f, limit) | ||||||
| 	} | 	} | ||||||
| 	while (tb != NULL && !PyOS_InterruptOccurred()) { | 	while (tb != NULL && !PyOS_InterruptOccurred()) { | ||||||
| 		if (depth <= limit) { | 		if (depth <= limit) { | ||||||
| 			tb->tb_lineno = PyCode_Addr2Line(tb->tb_frame->f_code, | 			if (Py_OptimizeFlag) | ||||||
| 							 tb->tb_lasti); | 				tb->tb_lineno = PyCode_Addr2Line( | ||||||
|  | 					tb->tb_frame->f_code, tb->tb_lasti); | ||||||
| 			tb_displayline(f, | 			tb_displayline(f, | ||||||
| 			    PyString_AsString( | 			    PyString_AsString( | ||||||
| 				    tb->tb_frame->f_code->co_filename), | 				    tb->tb_frame->f_code->co_filename), | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum