Skip to content

Commit 1bce562

Browse files
committed
add _thread.interupt_main stub
1 parent 46170d8 commit 1bce562

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,17 @@ Object setSentinel() {
269269
return sentinelLock;
270270
}
271271
}
272+
273+
@Builtin(name = "interrupt_main", minNumOfPositionalArgs = 1, declaresExplicitSelf = true, doc = "interrupt_main()\n" +
274+
"\n" +
275+
"Raise a KeyboardInterrupt in the main thread.\n" +
276+
"A subthread can use this function to interrupt the main thread.")
277+
@GenerateNodeFactory
278+
abstract static class InterruptMainThreadNode extends PythonUnaryBuiltinNode {
279+
@Specialization
280+
Object getCount(@SuppressWarnings("unused") PythonModule self) {
281+
// TODO: implement me
282+
return PNone.NONE;
283+
}
284+
}
272285
}

0 commit comments

Comments
 (0)