Skip to content

Commit

Permalink
Remove some unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
SijmenHuizenga committed May 5, 2024
1 parent 4b7bab4 commit 9bc4e99
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions schedule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,15 +921,3 @@ def _schedule_decorator(decorated_function):

return _schedule_decorator

def _datetime_exists(dattim: datetime.datetime) -> bool:
"""Check if a datetime exists."""
assert dattim.tzinfo is not None
original_tzinfo = dattim.tzinfo
# Check if we can round trip to UTC
return dattim == dattim.astimezone(datetime.UTC).astimezone(original_tzinfo)

def _datetime_ambiguous(dattim: datetime.datetime) -> bool:
"""Check whether a datetime is ambiguous."""
assert dattim.tzinfo is not None
opposite_fold = dattim.replace(fold=not dattim.fold)
return _datetime_exists(dattim) and dattim.utcoffset() != opposite_fold.utcoffset()

0 comments on commit 9bc4e99

Please sign in to comment.