ruff: Fix SIM300 Yoda conditions are discouraged.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2023-10-29 17:30:08 -07:00
parent 8b5b3958e1
commit 008efed12b

View file

@ -1219,11 +1219,11 @@ def parse_args() -> Tuple[optparse.Values, List[str]]:
def die_gracefully(signal: int, frame: Optional[FrameType]) -> None:
if CURRENT_STATE == States.ZulipToZephyr:
if States.ZulipToZephyr == CURRENT_STATE:
# this is a child process, so we want os._exit (no clean-up necessary)
os._exit(1)
if CURRENT_STATE == States.ZephyrToZulip and not options.use_sessions:
if States.ZephyrToZulip == CURRENT_STATE and not options.use_sessions:
try:
# zephyr=>zulip processes may have added subs, so run ZCancelSubscriptions
zephyr_ctypes.check(zephyr_ctypes.ZCancelSubscriptions(0))