28
28
Tuple [Generator [None , Result [object ], None ], HookImpl ],
29
29
Generator [None , object , object ],
30
30
]
31
+ else :
32
+
33
+ def cast (t , v ):
34
+ return v
31
35
32
36
from ._hooks import HookImpl
33
37
from ._result import HookCallError
@@ -94,7 +98,7 @@ def _multicall(
94
98
# If this cast is not valid, a type error is raised below,
95
99
# which is the desired response.
96
100
res = hook_impl .function (* args )
97
- wrapper_gen = cast (Generator [None , Result [object ], None ], res )
101
+ wrapper_gen = cast (" Generator[None, Result[object], None]" , res )
98
102
next (wrapper_gen ) # first yield
99
103
teardowns .append ((wrapper_gen , hook_impl ))
100
104
except StopIteration :
@@ -104,7 +108,7 @@ def _multicall(
104
108
# If this cast is not valid, a type error is raised below,
105
109
# which is the desired response.
106
110
res = hook_impl .function (* args )
107
- function_gen = cast (Generator [None , object , object ], res )
111
+ function_gen = cast (" Generator[None, object, object]" , res )
108
112
next (function_gen ) # first yield
109
113
teardowns .append (function_gen )
110
114
except StopIteration :
0 commit comments