diff --git a/src/libloomw/data/pyobj.cpp b/src/libloomw/data/pyobj.cpp index 40ee666e26b5d10cd89e400cc4d39c5891a2e651..37f92782a09bddf229f2d7391e24c12aa1f1a665 100644 --- a/src/libloomw/data/pyobj.cpp +++ b/src/libloomw/data/pyobj.cpp @@ -14,10 +14,7 @@ loom::PyObj::~PyObj() { PyGILState_STATE gstate; gstate = PyGILState_Ensure(); - - assert(obj->ob_refcnt > 0); Py_DecRef(obj); - PyGILState_Release(gstate); } diff --git a/tests/client/test_py.py b/tests/client/test_py.py index f513e8229c7341f4a50342bf9b190ec787a0de39..4c436e36a77ae3c30e71f77a4824c17b1a958c7c 100644 --- a/tests/client/test_py.py +++ b/tests/client/test_py.py @@ -287,3 +287,30 @@ def test_py_task_deserialization3(loom_env): objs = tuple(tasks.py_value(str(i + 1000)) for i in range(100)) x = tasks.array_make(objs) loom_env.submit_and_gather(x) + + +def test_rewrap_test(loom_env): + @tasks.py_task(context=True, n_direct_args=4) + def init(ctx): + content = [1, 2, 3] + return ctx.wrap(content) + + @tasks.py_task(context=True) + def center(ctx, train_test): + train, test = [t.unwrap() for t in train_test] + return [ctx.wrap(t) for t in (train, test)] + + @tasks.py_task(context=True) + def remove_empty_rows(ctx, train, test): + train = list(train.unwrap()) + test = list(test.unwrap()) + return [ctx.wrap(t) for t in (train, test)] + + train = init() + test = init() + mean_task = center(remove_empty_rows(train, test)) + smurff_tasks = [mean_task] + + loom_env.start(1) + futures = loom_env.client.submit(smurff_tasks) + results = loom_env.client.gather(futures) \ No newline at end of file