Skip to content

Commit

Permalink
✏️ fix RuntimeWarning that should be FutureWarning
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed May 8, 2024
1 parent b6e6f50 commit 0f23f31
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ozi/spec/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ class PythonSupport(Default):
)

def __post_init__(self: Self) -> None:
"""Warn the user if the python version is deprecated or pending deprecation.
:raises: FutureWarning
"""
python3_eol = (
datetime.strptime(
self.deprecation_schedule.get(
Expand All @@ -78,13 +82,13 @@ def __post_init__(self: Self) -> None:
if datetime.now(tz=timezone.utc).date() > python3_eol: # pragma: no cover
warn(
f'Python {pymajor}.{pyminor}.{pypatch} is not supported as of {python3_eol}.',
RuntimeWarning,
FutureWarning,
)
elif datetime.now(tz=timezone.utc).date() > ozi_support_eol: # pragma: no cover
warn(
f'Python {pymajor}.{pyminor}.{pypatch} support is pending deprecation '
f'as of {ozi_support_eol}.',
RuntimeWarning,
FutureWarning,
)

@cached_property
Expand Down

0 comments on commit 0f23f31

Please sign in to comment.