From 403837e52df05bea47ac8ff74184c01c2dc144f8 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 16 Sep 2022 18:20:47 -0700 Subject: [PATCH] =?UTF-8?q?python:=20Use=20=E2=80=98not=20in=E2=80=99=20fo?= =?UTF-8?q?r=20negated=20membership=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes “E713 Test for membership should be `not in`” found by ruff (https://github.com/charliermarsh/ruff). Signed-off-by: Anders Kaseorg --- scripts/lib/check_rabbitmq_queue.py | 2 +- zerver/lib/events.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/lib/check_rabbitmq_queue.py b/scripts/lib/check_rabbitmq_queue.py index 13857aa216..9fdc834ab4 100644 --- a/scripts/lib/check_rabbitmq_queue.py +++ b/scripts/lib/check_rabbitmq_queue.py @@ -129,7 +129,7 @@ def check_other_queues(queue_counts_dict: Dict[str, int]) -> List[Dict[str, Any] def check_rabbitmq_queues() -> None: pattern = re.compile(r"(\w+)\t(\d+)\t(\d+)") - if "USER" in os.environ and not os.environ["USER"] in ["root", "rabbitmq"]: + if "USER" in os.environ and os.environ["USER"] not in ["root", "rabbitmq"]: print("This script must be run as the root or rabbitmq user") list_queues_output = subprocess.check_output( diff --git a/zerver/lib/events.py b/zerver/lib/events.py index c4fb3d23c1..67c977cc84 100644 --- a/zerver/lib/events.py +++ b/zerver/lib/events.py @@ -1193,7 +1193,7 @@ def apply_event( state["starred_messages"] = [ message for message in state["starred_messages"] - if not (message in event["messages"]) + if message not in event["messages"] ] elif event["type"] == "realm_domains": if event["op"] == "add":