From 39cf394713f06f1d008a18b489ad042252ddb469 Mon Sep 17 00:00:00 2001 From: Ganden Schaffner Date: Thu, 5 Dec 2024 12:56:44 +0000 Subject: [PATCH] Avoid exposing extra variables key and value in anyio.abc (#833) Co-authored-by: Waket Zheng --- src/anyio/abc/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/anyio/abc/__init__.py b/src/anyio/abc/__init__.py index 1ca0fcf7..3d3b61cc 100644 --- a/src/anyio/abc/__init__.py +++ b/src/anyio/abc/__init__.py @@ -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 @@ -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