Skip to content

Commit 5e62ec7

Browse files
committed
chore: adapt output s.t. jan has less work
1 parent 2114b7a commit 5e62ec7

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

sentry_sdk/utils.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,15 @@ def get_lines_from_file(filename, lineno, loader=None, module=None):
169169
upper_bound = min(lineno + 1 + context_lines, len(source))
170170

171171
try:
172-
pre_context = [line.strip("\r\n") for line in source[lower_bound:lineno]]
173-
context_line = source[lineno].strip("\r\n")
172+
pre_context = [slim_string(line.strip("\r\n")) for line in source[lower_bound:lineno]]
173+
context_line = slim_string(source[lineno].strip("\r\n"))
174174
post_context = [
175-
line.strip("\r\n") for line in source[(lineno + 1) : upper_bound]
175+
slim_string(line.strip("\r\n")) for line in source[(lineno + 1) : upper_bound]
176176
]
177+
return pre_context, context_line, post_context
177178
except IndexError:
178179
# the file may have changed since it was loaded into memory
179-
return None, None, None
180-
181-
return (
182-
slim_string(pre_context),
183-
slim_string(context_line),
184-
slim_string(post_context),
185-
)
180+
return [], None, []
186181

187182

188183
def get_source_context(frame):

0 commit comments

Comments
 (0)