Skip to content

Commit

Permalink
fix: oops, used incorrect list index to pull details from stack
Browse files Browse the repository at this point in the history
  • Loading branch information
BobTheBuidler authored Jul 20, 2022
1 parent 05f0c18 commit 4f86f54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eth_retry/eth_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def should_retry(e: Exception, failures: int) -> bool:


def _get_caller_details_from_stack():
code_context = inspect.stack()[1].code_context
code_context = inspect.stack()[2].code_context
if code_context is None:
return f"{inspect.stack()[1].filename} line {inspect.stack()[1].lineno}"
return f"{inspect.stack()[1].filename} line {inspect.stack()[1].lineno} {[code_context[0].strip()]}"
return f"{inspect.stack()[2].filename} line {inspect.stack()[2].lineno}"
return f"{inspect.stack()[2].filename} line {inspect.stack()[2].lineno} {[code_context[0].strip()]}"

0 comments on commit 4f86f54

Please sign in to comment.