@@ -367,6 +367,10 @@ predicate scope_raises_unknown(Scope s) {
367
367
class ExceptFlowNode extends ControlFlowNode {
368
368
ExceptFlowNode ( ) { this .getNode ( ) instanceof ExceptStmt }
369
369
370
+ /**
371
+ * Gets the type handled by this exception handler.
372
+ * `ExceptionType` in `except ExceptionType as e:`
373
+ */
370
374
ControlFlowNode getType ( ) {
371
375
exists ( ExceptStmt ex |
372
376
this .getBasicBlock ( ) .dominates ( result .getBasicBlock ( ) ) and
@@ -375,6 +379,10 @@ class ExceptFlowNode extends ControlFlowNode {
375
379
)
376
380
}
377
381
382
+ /**
383
+ * Gets the name assigned to the handled exception, if any.
384
+ * `e` in `except ExceptionType as e:`
385
+ */
378
386
ControlFlowNode getName ( ) {
379
387
exists ( ExceptStmt ex |
380
388
this .getBasicBlock ( ) .dominates ( result .getBasicBlock ( ) ) and
@@ -443,11 +451,19 @@ class ExceptFlowNode extends ControlFlowNode {
443
451
class ExceptGroupFlowNode extends ControlFlowNode {
444
452
ExceptGroupFlowNode ( ) { this .getNode ( ) instanceof ExceptGroupStmt }
445
453
454
+ /**
455
+ * Gets the type handled by this exception handler.
456
+ * `eg` in `except* eg as e:`
457
+ */
446
458
ControlFlowNode getType ( ) {
447
459
this .getBasicBlock ( ) .dominates ( result .getBasicBlock ( ) ) and
448
460
result = this .getNode ( ) .( ExceptGroupStmt ) .getType ( ) .getAFlowNode ( )
449
461
}
450
462
463
+ /**
464
+ * Gets the name assigned to the handled exception, if any.
465
+ * `e` in `except* eg as e:`
466
+ */
451
467
ControlFlowNode getName ( ) {
452
468
this .getBasicBlock ( ) .dominates ( result .getBasicBlock ( ) ) and
453
469
result = this .getNode ( ) .( ExceptGroupStmt ) .getName ( ) .getAFlowNode ( )
0 commit comments