Protect against exception in linecache.getline. Fixes #969

This commit is contained in:
Fabio Zadrozny 2022-07-07 10:22:02 -03:00 committed by Pavel Minaev
parent 4f2a4568f0
commit 3f325f58dc
3 changed files with 2272 additions and 2225 deletions

File diff suppressed because it is too large Load diff

View file

@ -509,8 +509,7 @@ cdef class PyDBFrame:
try:
linecache.checkcache(absolute_filename)
except:
# Jython 2.1
linecache.checkcache()
pydev_log.exception('Error in linecache.checkcache(%r)', absolute_filename)
from_user_input = main_debugger.filename_to_lines_where_exceptions_are_ignored.get(canonical_normalized_filename)
if from_user_input:
@ -531,8 +530,8 @@ cdef class PyDBFrame:
try:
line = linecache.getline(absolute_filename, exc_lineno, check_trace_obj.tb_frame.f_globals)
except:
# Jython 2.1
line = linecache.getline(absolute_filename, exc_lineno)
pydev_log.exception('Error in linecache.getline(%r, %s, f_globals)', absolute_filename, exc_lineno)
line = ''
if IGNORE_EXCEPTION_TAG.match(line) is not None:
lines_ignored[exc_lineno] = 1

View file

@ -376,8 +376,7 @@ class PyDBFrame:
try:
linecache.checkcache(absolute_filename)
except:
# Jython 2.1
linecache.checkcache()
pydev_log.exception('Error in linecache.checkcache(%r)', absolute_filename)
from_user_input = main_debugger.filename_to_lines_where_exceptions_are_ignored.get(canonical_normalized_filename)
if from_user_input:
@ -398,8 +397,8 @@ class PyDBFrame:
try:
line = linecache.getline(absolute_filename, exc_lineno, check_trace_obj.tb_frame.f_globals)
except:
# Jython 2.1
line = linecache.getline(absolute_filename, exc_lineno)
pydev_log.exception('Error in linecache.getline(%r, %s, f_globals)', absolute_filename, exc_lineno)
line = ''
if IGNORE_EXCEPTION_TAG.match(line) is not None:
lines_ignored[exc_lineno] = 1