Skip to content

Commit

Permalink
[BUG] fix error message in _check_python_version (#5473)
Browse files Browse the repository at this point in the history
This PR fixes a minor issue in one of the error messages in
`_check_python_version`.

Example failure here:
#5424 (comment)
  • Loading branch information
fkiraly committed Oct 27, 2023
1 parent 6dcfbe5 commit 9d08f87
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sktime/utils/validation/_dependencies.py
Expand Up @@ -301,9 +301,14 @@ def _check_python_version(obj, package=None, msg=None, severity="error"):
return True
# now we know that est_version is not compatible with sys_version

if isclass(obj):
class_name = obj.__name__
else:
class_name = type(obj).__name__

if not isinstance(msg, str):
msg = (
f"{type(obj).__name__} requires python version to be {est_specifier},"
f"{class_name} requires python version to be {est_specifier},"
f" but system python version is {sys.version}."
)

Expand Down

0 comments on commit 9d08f87

Please sign in to comment.