8000 (wip) fix: name 'Response' is not defined · python-injector/flask_injector@4d8bfe8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4d8bfe8

Browse files
zhangchengalecthomas
authored andcommitted
(wip) fix: name 'Response' is not defined
Aim to resolve #69
1 parent a9fbf1c commit 4d8bfe8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

flask_injector/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,13 @@ def wrap_fun(fun: T, injector: Injector) -> T:
6262
if hasattr(fun, '__call__') and not isinstance(fun, type):
6363
try:
6464
type_hints = get_type_hints(fun)
65-
except (AttributeError, TypeError):
65+
except (AttributeError, TypeError, NameError):
6666
# Some callables aren't introspectable with get_type_hints,
6767
# let's assume they don't have anything to inject. The exception
6868
# types handled here are what I encountered so far.
6969
# It used to be AttributeError, then https://github.com/python/typing/pull/314
7070
# changed it to TypeError.
7171
wrap_it = False
72-
except NameError:
73-
wrap_it = True
7472
else:
7573
type_hints.pop('return', None)
7674
wrap_it = type_hints != {}

0 commit comments

Comments
 (0)
0