Skip to content

Commit

Permalink
Prevent generation of TypeError(TypeError(...)) exceptions (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
russok authored and agronholm committed Sep 14, 2019
1 parent 4761514 commit 8f48de0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typeguard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def check_return_type(retval, memo: Optional[_CallMemo] = None) -> bool:
try:
check_type('the return value', retval, memo.type_hints['return'], memo)
except TypeError as exc: # suppress unnecessarily long tracebacks
raise TypeError(exc) from None
raise exc from None

return True

Expand Down Expand Up @@ -589,7 +589,7 @@ def check_argument_types(memo: Optional[_CallMemo] = None) -> bool:
try:
check_type(description, value, expected_type, memo)
except TypeError as exc: # suppress unnecessarily long tracebacks
raise TypeError(exc) from None
raise exc from None

return True

Expand Down

0 comments on commit 8f48de0

Please sign in to comment.