From 16bc58d9076b24a85c2079ab24481a9d7a4347c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20D=C4=85dela?= Date: Sat, 9 Nov 2024 12:28:15 +0100 Subject: [PATCH] chore(deps): update ruff in pre-commit, apply fixes --- .pre-commit-config.yaml | 2 +- locust/log.py | 2 +- locust/runners.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9a2eab3ffc..2887a9616f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,7 +1,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.3.7 # Pin the same version in the pyproject.toml file + rev: v0.7.3 # Pin the same version in the pyproject.toml file hooks: # Run the linter. - id: ruff diff --git a/locust/log.py b/locust/log.py index 49a5207703..272fca4251 100644 --- a/locust/log.py +++ b/locust/log.py @@ -92,7 +92,7 @@ def greenlet_exception_logger(logger, level=logging.CRITICAL): """ def exception_handler(greenlet): - if greenlet.exc_info[0] == SystemExit: + if greenlet.exc_info[0] is SystemExit: logger.log( min(logging.INFO, level), # dont use higher than INFO for this, because it sounds way to urgent f"sys.exit({greenlet.exc_info[1]}) called (use log level DEBUG for callstack)", diff --git a/locust/runners.py b/locust/runners.py index a4165cfa40..297a1c89dc 100644 --- a/locust/runners.py +++ b/locust/runners.py @@ -248,7 +248,7 @@ def stop_users(self, user_classes_stop_count: dict[str, int]) -> None: "While stopping users, we encountered a user that didn't have proper args %s", user_greenlet ) continue - if type(user) == self.user_classes_by_name[user_class]: + if type(user) is self.user_classes_by_name[user_class]: to_stop.append(user) if not to_stop: