Skip to content

Commit

Permalink
Skip recording exceptions as return type
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Aug 31, 2020
1 parent cf8c27c commit c09670e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion record_api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,18 @@ def __call__(self) -> None:

def log_called_method(self):
if self.previous_stack.log_call_args:
tos = self.TOS
if type(tos) is type and issubclass(tos, Exception):
# Don't record exception
return
filename, line, fn, args, *kwargs = self.previous_stack.log_call_args
kwargs = kwargs[0] if kwargs else {}
log_call(
f"{filename}:{line}",
fn,
tuple(args),
*((kwargs,) if kwargs else ()),
return_type=type(self.TOS),
return_type=type(tos),
)

# special case subscr b/c we only check first arg, not both
Expand Down

0 comments on commit c09670e

Please sign in to comment.