Skip to content

Commit

Permalink
Avoid exposing extra variables key and value in anyio.abc (#833)
Browse files Browse the repository at this point in the history
Co-authored-by: Waket Zheng <waketzheng@gmail.com>
  • Loading branch information
gschaffner and waketzheng authored Dec 5, 2024
1 parent a2150f5 commit 39cf394
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/anyio/abc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from __future__ import annotations

from typing import Any

from ._eventloop import AsyncBackend as AsyncBackend
from ._resources import AsyncResource as AsyncResource
from ._sockets import ConnectedUDPSocket as ConnectedUDPSocket
Expand Down Expand Up @@ -50,8 +48,8 @@
from ..from_thread import BlockingPortal as BlockingPortal

# Re-export imports so they look like they live directly in this package
key: str
value: Any
for key, value in list(locals().items()):
if getattr(value, "__module__", "").startswith("anyio.abc."):
value.__module__ = __name__
for __value in list(locals().values()):
if getattr(__value, "__module__", "").startswith("anyio.abc."):
__value.__module__ = __name__

del __value

0 comments on commit 39cf394

Please sign in to comment.