Add runner context interrupting by TOMMy-Net · Pull Request #256 · go-python/gpython
"github.com/go-python/gpython/py" "github.com/go-python/gpython/stdlib/marshal"
// NewContext creates a new gpython interpreter instance context.
// See interface py.Context defined in py/run.go func (ctx *context) SetInterrupt() { ctx.interrupt.Store(1) }
// See interface py.Context defined in py/run.go func (ctx *context) CheckInterrupt() bool { return ctx.interrupt.Swap(0) != 0 }
func (ctx *context) pushBusy() error { if ctx.closed { return py.ExceptionNewf(py.RuntimeError, "Context closed")