8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9fbf1c commit 4d8bfe8Copy full SHA for 4d8bfe8
flask_injector/__init__.py
@@ -62,15 +62,13 @@ def wrap_fun(fun: T, injector: Injector) -> T:
62
if hasattr(fun, '__call__') and not isinstance(fun, type):
63
try:
64
type_hints = get_type_hints(fun)
65
- except (AttributeError, TypeError):
+ except (AttributeError, TypeError, NameError):
66
# Some callables aren't introspectable with get_type_hints,
67
# let's assume they don't have anything to inject. The exception
68
# types handled here are what I encountered so far.
69
# It used to be AttributeError, then https://github.com/python/typing/pull/314
70
# changed it to TypeError.
71
wrap_it = False
72
- except NameError:
73
- wrap_it = True
74
else:
75
type_hints.pop('return', None)
76
wrap_it = type_hints != {}
0 commit comments