diff --git a/locust/stats.py b/locust/stats.py index 640fe59a1b..ff7ad8df88 100644 --- a/locust/stats.py +++ b/locust/stats.py @@ -15,7 +15,7 @@ from html import escape from itertools import chain from types import FrameType -from typing import TYPE_CHECKING, Any, Callable, NoReturn, Protocol, TypedDict, TypeVar, cast +from typing import TYPE_CHECKING, Any, Callable, NoReturn, Optional, Protocol, TypedDict, TypeVar, cast import gevent @@ -185,7 +185,7 @@ class RequestStats: Class that holds the request statistics. Accessible in a User from self.environment.stats """ - def __init__(self, use_response_times_cache=True, environment: Environment | None = None): + def __init__(self, use_response_times_cache=True, environment: Optional[Environment]=None): """ :param use_response_times_cache: The value of use_response_times_cache will be set for each StatsEntry() when they are created. Settings it to False saves some memory and CPU