|
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 | # |
3 | | -# Copyright (C) 2009, 2010, 2015, 2017-2018 Rocky Bernstein |
| 3 | +# Copyright (C) 2009, 2010, 2015, 2017-2018, 2022 Rocky Bernstein |
4 | 4 | # This program is free software: you can redistribute it and/or modify |
5 | 5 | # it under the terms of the GNU General Public License as published by |
6 | 6 | # the Free Software Foundation, either version 3 of the License, or |
@@ -36,7 +36,11 @@ def set_break(cmd_obj, func, filename, lineno, condition, temporary, |
36 | 36 | filename = cmd_obj.core.canonic(filename) |
37 | 37 | pass |
38 | 38 | if func is None: |
39 | | - ok_linenos = pyficache.trace_line_numbers(filename) |
| 39 | + try: |
| 40 | + ok_linenos = pyficache.trace_line_numbers(filename) |
| 41 | + except: |
| 42 | + ok_linenos = None |
| 43 | + |
40 | 44 | if not ok_linenos or lineno not in ok_linenos: |
41 | 45 | part1 = ('File %s' % cmd_obj.core.filename(filename)) |
42 | 46 | msg = Mmisc.wrapped_lines(part1, |
@@ -95,7 +99,12 @@ def parse_break_cmd(proc, args): |
95 | 99 | location = bp_expr.location |
96 | 100 | condition = bp_expr.condition |
97 | 101 |
|
98 | | - location = resolve_location(proc, location) |
| 102 | + try: |
| 103 | + location = resolve_location(proc, location) |
| 104 | + except ValueError as e: |
| 105 | + proc.errmsg(str(e)) |
| 106 | + return INVALID_PARSE_BREAK |
| 107 | + |
99 | 108 | if location: |
100 | 109 | return location.method, location.path, location.line_number, condition |
101 | 110 | else: |
|
0 commit comments