File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,6 +392,12 @@ class Try extends Try_ {
392392 /** Gets an exception handler of this try statement. */
393393 override Stmt getAHandler ( ) { result = Try_ .super .getAHandler ( ) }
394394
395+ /** Gets a normal exception handler, `except`, of this try statement. */
396+ ExceptStmt getANormalHandler ( ) { result = this .getAHandler ( ) }
397+
398+ /** Gets a group exception handler, `except*`, of this try statement. */
399+ ExceptGroupStmt getAGroupHandler ( ) { result = this .getAHandler ( ) }
400+
395401 override Stmt getLastStatement ( ) {
396402 result = this .getFinalbody ( ) .getLastItem ( ) .getLastStatement ( )
397403 or
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ predicate iter_not_exhausted(EssaVariable iterator) {
5252predicate stop_iteration_handled ( CallNode call ) {
5353 exists ( Try t |
5454 t .containsInScope ( call .getNode ( ) ) and
55- t .getAHandler ( ) .getType ( ) = stopIteration ( ) .getAValueReachableFromSource ( ) .asExpr ( )
55+ t .getANormalHandler ( ) .getType ( ) = stopIteration ( ) .getAValueReachableFromSource ( ) .asExpr ( )
5656 )
5757}
5858
You can’t perform that action at this time.
0 commit comments