Skip to content

Commit

Permalink
Update retry.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos authored Sep 18, 2024
1 parent 0bfeb7f commit e40aabb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/langgraph/langgraph/pregel/retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def run_with_retry(
if isinstance(retry_policy.retry_on, Sequence):
if not isinstance(exc, tuple(retry_policy.retry_on)):
raise
elif isinstance(retry_policy.retry_on, type) and issubclass(retry_policy.retry_on, Exception):
elif isinstance(retry_policy.retry_on, type) and issubclass(
retry_policy.retry_on, Exception
):
if not isinstance(exc, retry_policy.retry_on):
raise
elif callable(retry_policy.retry_on):
Expand Down Expand Up @@ -105,7 +107,9 @@ async def arun_with_retry(
if isinstance(retry_policy.retry_on, Sequence):
if not isinstance(exc, tuple(retry_policy.retry_on)):
raise
elif isinstance(retry_policy.retry_on, type) and issubclass(retry_policy.retry_on, Exception):
elif isinstance(retry_policy.retry_on, type) and issubclass(
retry_policy.retry_on, Exception
):
if not isinstance(exc, retry_policy.retry_on):
raise
elif callable(retry_policy.retry_on):
Expand Down

0 comments on commit e40aabb

Please sign in to comment.