diff --git a/web3/_utils/module.py b/web3/_utils/module.py index 834b62ccf9..2a5e144f08 100644 --- a/web3/_utils/module.py +++ b/web3/_utils/module.py @@ -4,21 +4,20 @@ Dict, Optional, Sequence, - TypeVar, + Union, ) from web3.exceptions import ( ValidationError, ) -T = TypeVar("T") - if TYPE_CHECKING: from web3 import Web3 # noqa: F401 + from web3.module import ModuleV2 # noqa: F401 def attach_modules( - parent_module: T, + parent_module: Union["Web3", "ModuleV2"], module_definitions: Dict[str, Sequence[Any]], w3: Optional["Web3"] = None ) -> None: