diff options
Diffstat (limited to 'Lib/ast.py')
| -rw-r--r-- | Lib/ast.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/ast.py b/Lib/ast.py index 61fbe030a7..0d3b19d922 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -332,6 +332,8 @@ def get_source_segment(source, node, *, padded=False): be padded with spaces to match its original position. """ try: + if node.end_lineno is None or node.end_col_offset is None: + return None lineno = node.lineno - 1 end_lineno = node.end_lineno - 1 col_offset = node.col_offset |
