diff --git a/pandas/core/series.py b/pandas/core/series.py index c79ecd554bed5..e4b69e2b62e9b 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -3441,8 +3441,9 @@ def sort_values( ) ascending = ascending[0] - if not is_bool(ascending): - raise ValueError("ascending must be boolean") + + if type(ascending)!=bool: + raise ValueError("ascending should be of type bool") if na_position not in ["first", "last"]: raise ValueError(f"invalid na_position: {na_position}")