Search in sources :

Example 1 with PyFinallyPart

use of com.jetbrains.python.psi.PyFinallyPart in project intellij-community by JetBrains.

the class PyWithTryFinallySurrounder method getResultRange.

@Override
protected TextRange getResultRange(PyTryExceptStatement tryStatement) {
    final PyFinallyPart finallyPart = tryStatement.getFinallyPart();
    assert finallyPart != null;
    final PyStatementList statementList = finallyPart.getStatementList();
    return statementList.getTextRange();
}
Also used : PyFinallyPart(com.jetbrains.python.psi.PyFinallyPart) PyStatementList(com.jetbrains.python.psi.PyStatementList)

Aggregations

PyFinallyPart (com.jetbrains.python.psi.PyFinallyPart)1 PyStatementList (com.jetbrains.python.psi.PyStatementList)1