diff --git a/panda/src/event/asyncFuture_ext.cxx b/panda/src/event/asyncFuture_ext.cxx index 470bb6f128..92b3d837d1 100644 --- a/panda/src/event/asyncFuture_ext.cxx +++ b/panda/src/event/asyncFuture_ext.cxx @@ -63,13 +63,13 @@ static PyObject *get_done_result(const AsyncFuture *future) { // If it's an AsyncGatheringFuture, get the result for each future. const AsyncGatheringFuture *gather = (const AsyncGatheringFuture *)future; Py_ssize_t num_futures = (Py_ssize_t)gather->get_num_futures(); - PyObject *results = PyTuple_New(num_futures); + PyObject *results = PyList_New(num_futures); for (Py_ssize_t i = 0; i < num_futures; ++i) { PyObject *result = get_done_result(gather->get_future((size_t)i)); if (result != nullptr) { // This steals a reference. - PyTuple_SET_ITEM(results, i, result); + PyList_SET_ITEM(results, i, result); } else { Py_DECREF(results); return nullptr; diff --git a/tests/event/test_futures.py b/tests/event/test_futures.py index 73e0627295..ee6b0f2894 100644 --- a/tests/event/test_futures.py +++ b/tests/event/test_futures.py @@ -527,7 +527,7 @@ def test_future_gather(): assert gather.done() assert not gather.cancelled() - assert check_result(gather, (1, 2)) + assert check_result(gather, [1, 2]) def test_future_gather_cancel_inner():