diff --git a/sphinx/util/_pathlib.py b/sphinx/util/_pathlib.py index db22c927a1c..59980e96114 100644 --- a/sphinx/util/_pathlib.py +++ b/sphinx/util/_pathlib.py @@ -38,6 +38,12 @@ def __add__(self, other): warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2) return self.__str__() + other + def __bool__(self): + if not self.__str__(): + warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2) + return False + return True + def __contains__(self, item): warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2) return item in self.__str__() @@ -79,6 +85,12 @@ def __add__(self, other): warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2) return self.__str__() + other + def __bool__(self): + if not self.__str__(): + warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2) + return False + return True + def __contains__(self, item): warnings.warn(_MSG, RemovedInSphinx80Warning, stacklevel=2) return item in self.__str__()