mirror of https://github.com/locustio/locust.git
Update syntax to match what ruff recommends for Python 3.10
This commit is contained in:
parent
0a43546504
commit
efc565b02e
|
@ -2,7 +2,8 @@ from locust import User
|
|||
from locust.exception import LocustError
|
||||
|
||||
import time
|
||||
from typing import Any, Callable
|
||||
from collections.abc import Callable
|
||||
from typing import Any
|
||||
|
||||
import grpc
|
||||
import grpc.experimental.gevent as grpc_gevent
|
||||
|
|
|
@ -373,12 +373,10 @@ class ResponseContextManager(LocustResponse):
|
|||
while (
|
||||
isinstance(
|
||||
e,
|
||||
(
|
||||
requests.exceptions.ConnectionError,
|
||||
requests.packages.urllib3.exceptions.ProtocolError,
|
||||
requests.packages.urllib3.exceptions.MaxRetryError,
|
||||
requests.packages.urllib3.exceptions.NewConnectionError,
|
||||
),
|
||||
requests.exceptions.ConnectionError
|
||||
| requests.packages.urllib3.exceptions.ProtocolError
|
||||
| requests.packages.urllib3.exceptions.MaxRetryError
|
||||
| requests.packages.urllib3.exceptions.NewConnectionError,
|
||||
)
|
||||
and e.__context__ # Not sure if the above exceptions can ever be the lowest level, but it is good to be sure
|
||||
):
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Callable
|
||||
from operator import methodcaller
|
||||
from typing import Callable, TypeVar
|
||||
from typing import TypeVar
|
||||
|
||||
from configargparse import Namespace
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import collections
|
|||
import logging
|
||||
import os
|
||||
import sys
|
||||
from typing import Callable
|
||||
from collections.abc import Callable
|
||||
|
||||
import gevent
|
||||
|
||||
|
|
|
@ -14,10 +14,10 @@ import time
|
|||
import traceback
|
||||
from abc import abstractmethod
|
||||
from collections import defaultdict
|
||||
from collections.abc import Iterator, MutableMapping, ValuesView
|
||||
from collections.abc import Callable, Iterator, MutableMapping, ValuesView
|
||||
from operator import itemgetter, methodcaller
|
||||
from types import TracebackType
|
||||
from typing import TYPE_CHECKING, Any, Callable, NoReturn, TypedDict, cast
|
||||
from typing import TYPE_CHECKING, Any, NoReturn, TypedDict, cast
|
||||
from uuid import uuid4
|
||||
|
||||
import gevent
|
||||
|
|
|
@ -9,12 +9,12 @@ import signal
|
|||
import time
|
||||
from abc import abstractmethod
|
||||
from collections import OrderedDict, defaultdict, namedtuple
|
||||
from collections.abc import Iterable
|
||||
from collections.abc import Callable, Iterable
|
||||
from copy import copy
|
||||
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, NoReturn, Protocol, TypedDict, TypeVar, cast
|
||||
|
||||
import gevent
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ import logging
|
|||
import random
|
||||
import traceback
|
||||
from collections import deque
|
||||
from collections.abc import Callable
|
||||
from time import time
|
||||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Callable,
|
||||
Protocol,
|
||||
TypeVar,
|
||||
final,
|
||||
|
|
|
@ -16,7 +16,8 @@ from locust.util import deprecation
|
|||
import logging
|
||||
import time
|
||||
import traceback
|
||||
from typing import Callable, final
|
||||
from collections.abc import Callable
|
||||
from typing import final
|
||||
|
||||
from gevent import GreenletExit, greenlet
|
||||
from gevent.pool import Group
|
||||
|
|
Loading…
Reference in New Issue