Skip to content

Commit

Permalink
fix: using Optional syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
tyge68 committed Oct 26, 2024
1 parent 96681f1 commit d4cbd9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions locust/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d4cbd9d

Please sign in to comment.