diff --git a/stingray/base.py b/stingray/base.py index a1c5474f5..ce0b5c04e 100644 --- a/stingray/base.py +++ b/stingray/base.py @@ -511,7 +511,7 @@ def write(self, filename: str, fmt: str = None) -> None: os.unlink(probe_file) raise ValueError("float128") except ValueError as e: - if not "float128" in str(e): # pragma: no cover + if "float128" not in str(e): # pragma: no cover raise warnings.warn( f"{fmt} output does not allow saving metadata at maximum precision. " @@ -525,7 +525,7 @@ def write(self, filename: str, fmt: str = None) -> None: os.unlink(probe_file) CAN_SERIALIZE_META = True except TypeError as e: - if not "serialize_meta" in str(e): + if "serialize_meta" not in str(e): raise warnings.warn( f"{fmt} output does not serialize the metadata at the moment. "