Skip to content

Commit

Permalink
fix: review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Flix6x committed May 10, 2024
1 parent 149a833 commit 9b0f325
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions aioresponses/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,12 @@ async def match(
else:
return None

if matcher.repeat in (False, 1):
del self._matches[key]
elif matcher.repeat == 2:
matcher.repeat = False
elif isinstance(matcher.repeat, int):
if isinstance(matcher.repeat, bool):
if not matcher.repeat:
del self._matches[key]
else:
if matcher.repeat == 1:
del self._matches[key]
matcher.repeat -= 1

if self.is_exception(response_or_exc):
Expand Down

0 comments on commit 9b0f325

Please sign in to comment.