@@ -840,7 +840,7 @@ public static AuditNode create() {
840
840
abstract static class SysAuditNode extends PythonBuiltinNode {
841
841
@ Specialization
842
842
@ SuppressWarnings ("unused" )
843
- Object doAudit (VirtualFrame frame , Object [] args ) {
843
+ Object doAudit (VirtualFrame frame , Object event , Object [] args ) {
844
844
// TODO: Stub audit hooks implementation for PEP 578
845
845
return PNone .NONE ;
846
846
}
@@ -1458,16 +1458,19 @@ Object setRecLim(VirtualFrame frame, @SuppressWarnings("unused") PythonModule sy
1458
1458
throw raise (TypeError , S_EXPECTED_GOT_P , "integer" , limit );
1459
1459
}
1460
1460
1461
+ int newLimit ;
1461
1462
try {
1462
- final int newLimit = longAsIntNode .execute (frame , limit );
1463
- if ( newLimit < 1 ) {
1464
- throw raise ( ValueError , REC_LIMIT_GREATER_THAN_1 ) ;
1465
- }
1463
+ newLimit = longAsIntNode .execute (frame , limit );
1464
+ } catch ( PException pe ) {
1465
+ newLimit = - 1 ;
1466
+ }
1466
1467
1467
- // TODO: check to see if Issue #25274 applies
1468
- getContext ().getSysModuleState ().setRecursionLimit (newLimit );
1469
- } catch (PException ignore ) {
1468
+ if (newLimit < 1 ) {
1469
+ throw raise (ValueError , REC_LIMIT_GREATER_THAN_1 );
1470
1470
}
1471
+
1472
+ // TODO: check to see if Issue #25274 applies
1473
+ getContext ().getSysModuleState ().setRecursionLimit (newLimit );
1471
1474
return PNone .NONE ;
1472
1475
}
1473
1476
}
@@ -1547,17 +1550,12 @@ abstract static class SetSwitchIntervalNode extends PythonBuiltinNode {
1547
1550
1548
1551
@ Specialization
1549
1552
Object setCheckInterval (VirtualFrame frame , @ SuppressWarnings ("unused" ) PythonModule sys , Object arg ,
1550
- @ Cached PyFloatAsDoubleNode floatAsDoubleNode ,
1551
- @ Cached PyFloatCheckExactNode floatCheckExactNode ) {
1552
- try {
1553
- double interval = floatAsDoubleNode .execute (frame , arg );
1554
- if (interval <= 0.0 ) {
1555
- throw raise (ValueError , SWITCH_INTERVAL_MUST_BE_POSITIVE );
1556
- }
1557
- getContext ().getSysModuleState ().setSwitchInterval (FACTOR * interval );
1558
- } catch (PException ignore ) {
1559
-
1553
+ @ Cached PyFloatAsDoubleNode floatAsDoubleNode ) {
1554
+ double interval = floatAsDoubleNode .execute (frame , arg );
1555
+ if (interval <= 0.0 ) {
1556
+ throw raise (ValueError , SWITCH_INTERVAL_MUST_BE_POSITIVE );
1560
1557
}
1558
+ getContext ().getSysModuleState ().setSwitchInterval (FACTOR * interval );
1561
1559
return PNone .NONE ;
1562
1560
}
1563
1561
}
0 commit comments