Skip to content

Commit

Permalink
A004 Ignore exceptiongroup imports shadowing builtins
Browse files Browse the repository at this point in the history
I feel like this is a bug, so astral-sh/ruff#13037
is tracking this.
  • Loading branch information
CoolCat467 committed Aug 22, 2024
1 parent 37a0f28 commit 240c1b4
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/trio/_core/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
)

if sys.version_info < (3, 11):
from exceptiongroup import BaseExceptionGroup
from exceptiongroup import BaseExceptionGroup # noqa: A004


if TYPE_CHECKING:
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_core/_tests/test_exceptiongroup_gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from types import TracebackType

if sys.version_info < (3, 11):
from exceptiongroup import ExceptionGroup
from exceptiongroup import ExceptionGroup # noqa: A004


def raiser1() -> NoReturn:
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_core/_tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
)

if sys.version_info < (3, 11):
from exceptiongroup import BaseExceptionGroup, ExceptionGroup
from exceptiongroup import BaseExceptionGroup, ExceptionGroup # noqa: A004


T = TypeVar("T")
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_highlevel_open_tcp_listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from collections.abc import Awaitable, Callable

if sys.version_info < (3, 11):
from exceptiongroup import ExceptionGroup
from exceptiongroup import ExceptionGroup # noqa: A004


# Default backlog size:
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_highlevel_open_tcp_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from socket import AddressFamily, SocketKind

if sys.version_info < (3, 11):
from exceptiongroup import BaseExceptionGroup, ExceptionGroup
from exceptiongroup import BaseExceptionGroup, ExceptionGroup # noqa: A004


# Implementation of RFC 6555 "Happy eyeballs"
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_tests/test_highlevel_open_tcp_listeners.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from .._core._tests.tutil import binds_ipv6

if sys.version_info < (3, 11):
from exceptiongroup import BaseExceptionGroup
from exceptiongroup import BaseExceptionGroup # noqa: A004

if TYPE_CHECKING:
from typing_extensions import Buffer
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_tests/test_highlevel_open_tcp_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from trio.testing import MockClock

if sys.version_info < (3, 11):
from exceptiongroup import BaseExceptionGroup
from exceptiongroup import BaseExceptionGroup # noqa: A004


def test_close_all() -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_tests/test_testing_raisesgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from trio.testing import Matcher, RaisesGroup

if sys.version_info < (3, 11):
from exceptiongroup import ExceptionGroup
from exceptiongroup import ExceptionGroup # noqa: A004


def wrap_escape(s: str) -> str:
Expand Down
2 changes: 1 addition & 1 deletion src/trio/_tests/type_tests/raisesgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from typing_extensions import assert_type

if sys.version_info < (3, 11):
from exceptiongroup import BaseExceptionGroup, ExceptionGroup
from exceptiongroup import BaseExceptionGroup, ExceptionGroup # noqa: A004

# split into functions to isolate the different scopes

Expand Down
2 changes: 1 addition & 1 deletion src/trio/testing/_check_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
ArgsT = ParamSpec("ArgsT")

if sys.version_info < (3, 11):
from exceptiongroup import BaseExceptionGroup
from exceptiongroup import BaseExceptionGroup # noqa: A004

Res1 = TypeVar("Res1", bound=AsyncResource)
Res2 = TypeVar("Res2", bound=AsyncResource)
Expand Down
2 changes: 1 addition & 1 deletion src/trio/testing/_raises_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
# These two typevars are special cased in sphinx config to workaround lookup bugs.

if sys.version_info < (3, 11):
from exceptiongroup import BaseExceptionGroup
from exceptiongroup import BaseExceptionGroup # noqa: A004


@final
Expand Down

0 comments on commit 240c1b4

Please sign in to comment.