Skip to content

Commit 11dd7e6

Browse files
committed
SysAuditNode missing event arg
1 parent 4d613e2 commit 11dd7e6

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SysModuleBuiltins.java

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ public static AuditNode create() {
840840
abstract static class SysAuditNode extends PythonBuiltinNode {
841841
@Specialization
842842
@SuppressWarnings("unused")
843-
Object doAudit(VirtualFrame frame, Object[] args) {
843+
Object doAudit(VirtualFrame frame, Object event, Object[] args) {
844844
// TODO: Stub audit hooks implementation for PEP 578
845845
return PNone.NONE;
846846
}
@@ -1458,16 +1458,19 @@ Object setRecLim(VirtualFrame frame, @SuppressWarnings("unused") PythonModule sy
14581458
throw raise(TypeError, S_EXPECTED_GOT_P, "integer", limit);
14591459
}
14601460

1461+
int newLimit;
14611462
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+
}
14661467

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);
14701470
}
1471+
1472+
// TODO: check to see if Issue #25274 applies
1473+
getContext().getSysModuleState().setRecursionLimit(newLimit);
14711474
return PNone.NONE;
14721475
}
14731476
}
@@ -1547,17 +1550,12 @@ abstract static class SetSwitchIntervalNode extends PythonBuiltinNode {
15471550

15481551
@Specialization
15491552
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);
15601557
}
1558+
getContext().getSysModuleState().setSwitchInterval(FACTOR * interval);
15611559
return PNone.NONE;
15621560
}
15631561
}

0 commit comments

Comments
 (0)