Skip to content

Commit

Permalink
fix: Linting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Jul 5, 2019
1 parent 6c2c856 commit fb66204
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sentry_sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def safe_repr(value):


def filename_for_module(module, abs_path):
# type: (str, str) -> str
# type: (str, str) -> Optional[str]
try:
if abs_path.endswith(".pyc"):
abs_path = abs_path[:-1]
Expand Down Expand Up @@ -395,7 +395,10 @@ def serialize_frame(frame, tb_lineno=None, with_locals=True):
pre_context, context_line, post_context = get_source_context(frame, tb_lineno)

rv = {
"filename": filename_for_module(module, abs_path) or None,
"filename": module
and abs_path
and filename_for_module(module, abs_path)
or None,
"abs_path": os.path.abspath(abs_path) if abs_path else None,
"function": function or "<unknown>",
"module": module,
Expand Down

0 comments on commit fb66204

Please sign in to comment.