_called_with_wrong_args() — flask Function Reference
Architecture documentation for the _called_with_wrong_args() function in cli.py from the flask codebase.
Entity Profile
Dependency Diagram
graph TD c9d5aa34_1bf5_6777_6447_72b24ceb6b6b["_called_with_wrong_args()"] a96499c3_f8a9_e782_f156_1c1ee4a86c69["cli.py"] c9d5aa34_1bf5_6777_6447_72b24ceb6b6b -->|defined in| a96499c3_f8a9_e782_f156_1c1ee4a86c69 61227b34_c67c_0bff_1c83_c375e071843e["find_best_app()"] 61227b34_c67c_0bff_1c83_c375e071843e -->|calls| c9d5aa34_1bf5_6777_6447_72b24ceb6b6b 01192b9e_44fd_d2d6_4d3d_b0fadc14cc11["find_app_by_string()"] 01192b9e_44fd_d2d6_4d3d_b0fadc14cc11 -->|calls| c9d5aa34_1bf5_6777_6447_72b24ceb6b6b style c9d5aa34_1bf5_6777_6447_72b24ceb6b6b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/flask/cli.py lines 94–117
def _called_with_wrong_args(f: t.Callable[..., Flask]) -> bool:
"""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.
"""
tb = sys.exc_info()[2]
try:
while tb is not None:
if tb.tb_frame.f_code is f.__code__:
# In the function, it was called successfully.
return False
tb = tb.tb_next
# Didn't reach the function.
return True
finally:
# Delete tb to break a circular reference.
# https://docs.python.org/2/library/sys.html#sys.exc_info
del tb
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does _called_with_wrong_args() do?
_called_with_wrong_args() is a function in the flask codebase, defined in src/flask/cli.py.
Where is _called_with_wrong_args() defined?
_called_with_wrong_args() is defined in src/flask/cli.py at line 94.
What calls _called_with_wrong_args()?
_called_with_wrong_args() is called by 2 function(s): find_app_by_string, find_best_app.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free