File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,12 @@ class Try extends Try_ {
392
392
/** Gets an exception handler of this try statement. */
393
393
override Stmt getAHandler ( ) { result = Try_ .super .getAHandler ( ) }
394
394
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
+
395
401
override Stmt getLastStatement ( ) {
396
402
result = this .getFinalbody ( ) .getLastItem ( ) .getLastStatement ( )
397
403
or
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ predicate iter_not_exhausted(EssaVariable iterator) {
52
52
predicate stop_iteration_handled ( CallNode call ) {
53
53
exists ( Try t |
54
54
t .containsInScope ( call .getNode ( ) ) and
55
- t .getAHandler ( ) .getType ( ) = stopIteration ( ) .getAValueReachableFromSource ( ) .asExpr ( )
55
+ t .getANormalHandler ( ) .getType ( ) = stopIteration ( ) .getAValueReachableFromSource ( ) .asExpr ( )
56
56
)
57
57
}
58
58
You can’t perform that action at this time.
0 commit comments