Try Block AST Python Object
The TryBlock
object matches a Python function, module or object call.
The astType
value for this node is trystatement
.
Code Pattern
This AST element captures the following code.
try:
...
except ExceptionName:
...
finally:
...
Attributes
content
(typeAstElement
): the content of the try block (e.g. the statements in the block)exceptClauses
(array orExceptClause
): a list of exception in theexcept
clausefinallyClause
(typeFinallyClause
): the finally clause