Sorry, I pressed the sent button a bit too soon... I meant to add: It might be possible that such a callback function in B is called asynchronously after Py_Finalize has tore down the interpreter, in this case it's probably wise to also check if there is an interpreter state. Hans