Skip to content

Commit a56a877

Browse files
committed
Don't use get_annotations.
1 parent d7de25c commit a56a877

1 file changed

Lines changed: 9 additions & 18 deletions

File tree

typemap/type_eval/_apply_generic.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,10 @@ def _resolved_function_signature(
294294
sig = sig.replace(
295295
parameters=params, return_annotation=return_annotation
296296
)
297+
return sig
297298

298-
return sig
299+
else:
300+
return None
299301

300302

301303
def get_local_defns(
@@ -335,26 +337,15 @@ def get_local_defns(
335337
# TODO: This annos_ok thing is a hack because processing
336338
# __annotations__ on methods broke stuff and I didn't want
337339
# to chase it down yet.
338-
stuck = False
339-
try:
340-
rr = get_annotations(
341-
stuff, boxed.str_args, cls=boxed.cls, annos_ok=False
342-
)
343-
except _eval_typing.StuckException:
344-
stuck = True
345-
rr = None
346-
347340
resolved_sig = None
348-
if rr is not None:
349-
resolved_sig = _resolved_function_signature(
350-
stuff, boxed.str_args, definition_cls=boxed.cls
351-
)
352-
elif not stuck and getattr(stuff, "__annotations__", None):
353-
# XXX: This is totally wrong; we still need to do
354-
# substitute in class vars
341+
try:
355342
resolved_sig = _resolved_function_signature(
356-
stuff, boxed.str_args, definition_cls=boxed.cls
343+
stuff,
344+
boxed.str_args,
345+
definition_cls=boxed.cls,
357346
)
347+
except _eval_typing.StuckException:
348+
pass
358349
overloads = typing.get_overloads(stuff)
359350

360351
# If the method has type params, we build a GenericCallable

0 commit comments

Comments
 (0)