MCPcopy Create free account
hub / github.com/pallets/quart / _called_with_wrong_args

Function _called_with_wrong_args

src/quart/cli.py:40–62  ·  view source on GitHub ↗

Check whether calling a function raised a ``TypeError`` because the call failed or because something in the factory raised the error. :param f: The function that was called. :return: ``True`` if the call failed.

(f: Callable)

Source from the content-addressed store, hash-verified

38
39
40def _called_with_wrong_args(f: Callable) -> bool:
41 """Check whether calling a function raised a ``TypeError`` because
42 the call failed or because something in the factory raised the
43 error.
44 :param f: The function that was called.
45 :return: ``True`` if the call failed.
46 """
47 tb = sys.exc_info()[2]
48
49 try:
50 while tb is not None:
51 if tb.tb_frame.f_code is f.__code__:
52 # In the function, it was called successfully.
53 return False
54
55 tb = tb.tb_next
56
57 # Didn't reach the function.
58 return True
59 finally:
60 # Delete tb to break a circular reference.
61 # https://docs.python.org/2/library/sys.html#sys.exc_info
62 del tb
63
64
65def find_best_app(module: ModuleType) -> Quart:

Callers 2

find_best_appFunction · 0.85
find_app_by_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…