Fix build failure by moving control-flow image

This commit is contained in:
Felicity Chapman
2020-02-12 17:16:31 +00:00
parent 8db3651dfd
commit 39ba3dedc1
2 changed files with 7 additions and 10 deletions

View File

@@ -1,9 +0,0 @@
Python control flow graph
=========================
:doc:`Back to tutorial: control flow analysis <control-flow>`
|Python control flow graph|
.. |Python control flow graph| image:: ../../images/python-flow-graph.png

View File

@@ -19,7 +19,13 @@ To show why this complex relation is required consider the following Python code
finally:
close_resource()
There are many paths through the above code. There are three different paths through the call to ``close_resource();`` one normal path, one path that breaks out of the loop, and one path where an exception is raised by ``might_raise()``. (An annotated flow graph can be seen :doc:`here <control-flow-graph>`.)
There are many paths through the above code. There are three different paths through the call to ``close_resource();`` one normal path, one path that breaks out of the loop, and one path where an exception is raised by ``might_raise()``.
An annotated flow graph:
|Python control flow graph|
.. |Python control flow graph| image:: ../../images/python-flow-graph.png
The simplest use of the ``ControlFlowNode`` and ``AstNode`` classes is to find unreachable code. There is one ``ControlFlowNode`` per path through any ``AstNode`` and any ``AstNode`` that is unreachable has no paths flowing through it. Therefore, any ``AstNode`` without a corresponding ``ControlFlowNode`` is unreachable.