Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly check the version for deprecation #5772

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions holoviews/util/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def find_stack_level():
stacklevel = 0
while frame:
fname = inspect.getfile(frame)
if (
fname.startswith(pkg_dir) or fname.startswith(param_dir)
) and not fname.startswith(test_dir):
if fname.startswith((pkg_dir, param_dir)) and not fname.startswith(test_dir):
frame = frame.f_back
stacklevel += 1
else:
Expand All @@ -57,7 +55,7 @@ def deprecated(remove_version, old, new=None, extra=None):
if isinstance(remove_version, str):
remove_version = Version(remove_version)

if remove_version < current_version:
if remove_version <= current_version:
# This error is mainly for developers to remove the deprecated.
raise ValueError(
f"{old!r} should have been removed in {remove_version}, current version {current_version}."
Expand Down