Merge pull request #8729 from asottile/revert-traceback-frame
Revert "Merge pull request #8227 from encukou/defensive-get_source"
This commit is contained in:
		
						commit
						bb9683deea
					
				| 
						 | 
					@ -725,11 +725,11 @@ class FormattedExcinfo:
 | 
				
			||||||
    ) -> List[str]:
 | 
					    ) -> List[str]:
 | 
				
			||||||
        """Return formatted and marked up source lines."""
 | 
					        """Return formatted and marked up source lines."""
 | 
				
			||||||
        lines = []
 | 
					        lines = []
 | 
				
			||||||
        if source is not None and line_index < 0:
 | 
					        if source is None or line_index >= len(source.lines):
 | 
				
			||||||
            line_index += len(source.lines)
 | 
					 | 
				
			||||||
        if source is None or line_index >= len(source.lines) or line_index < 0:
 | 
					 | 
				
			||||||
            source = Source("???")
 | 
					            source = Source("???")
 | 
				
			||||||
            line_index = 0
 | 
					            line_index = 0
 | 
				
			||||||
 | 
					        if line_index < 0:
 | 
				
			||||||
 | 
					            line_index += len(source)
 | 
				
			||||||
        space_prefix = "    "
 | 
					        space_prefix = "    "
 | 
				
			||||||
        if short:
 | 
					        if short:
 | 
				
			||||||
            lines.append(space_prefix + source.lines[line_index].strip())
 | 
					            lines.append(space_prefix + source.lines[line_index].strip())
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue