Skip to content

Commit

Permalink
Fix instance checks
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdedude committed May 6, 2024
1 parent c963608 commit d2872d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions freezegun/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def __call__(self) -> datetime.datetime:
return self.time_to_freeze

def tick(self, delta: Union[datetime.timedelta, float]=datetime.timedelta(seconds=1)) -> datetime.datetime:
if isinstance(delta, float):
if isinstance(delta, (int, float)):
# noinspection PyTypeChecker
self.time_to_freeze += datetime.timedelta(seconds=delta)
else:
Expand Down Expand Up @@ -560,7 +560,7 @@ def __call__(self) -> datetime.datetime:
def tick(self, delta: Union[datetime.timedelta, float, None]=None) -> datetime.datetime:
if not delta:
delta = datetime.timedelta(seconds=self.step_width)
elif isinstance(delta, float):
elif isinstance(delta, (int, float)):
delta = datetime.timedelta(seconds=delta)
self.time_to_freeze += delta # type: ignore
return self.time_to_freeze
Expand Down

0 comments on commit d2872d0

Please sign in to comment.