Method: flask.cli._called_with_wrong_args
Calls: 3, Exceptions: 0, Paths: 2Back
Path 1: 2 calls (0.67)
test_find_best_app.
1def _called_with_wrong_args(f):
2 """Check whether calling a function raised a ``TypeError`` because
3 the call failed or because something in the factory raised the
4 error.
5
6 :param f: The function that was called.
7 :return: ``True`` if the call failed.
8 """
9 tb = sys.exc_info()[2]
10
11 try:
12 while tb is not None:
13 if tb.tb_frame.f_code is f.__code__:
14 # In the function, it was called successfully.
15 return False
16
17 tb = tb.tb_next
18
19 # Didn't reach the function.
20 return True
21 finally:
22 # Delete tb to break a circular reference.
23 # https://docs.python.org/2/library/sys.html#sys.exc_info
24 del tb
Path 2: 1 calls (0.33)
test_find_best_app.
1def _called_with_wrong_args(f):
2 """Check whether calling a function raised a ``TypeError`` because
3 the call failed or because something in the factory raised the
4 error.
5
6 :param f: The function that was called.
7 :return: ``True`` if the call failed.
8 """
9 tb = sys.exc_info()[2]
10
11 try:
12 while tb is not None:
13 if tb.tb_frame.f_code is f.__code__:
14 # In the function, it was called successfully.
15 return False
16
17 tb = tb.tb_next
18
19 # Didn't reach the function.
20 return True
21 finally:
22 # Delete tb to break a circular reference.
23 # https://docs.python.org/2/library/sys.html#sys.exc_info
24 del tb