mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
event: (BREAKING CHANGE) bare yield in task now means "cont"
This is more useful and consistent; you can after all just use "return" to end the task, whereas you can now just use "yield" to continue the next frame rather than "yield Task.cont". This is a follow-up to f6b39345f718b3ea9e6d01e9e71c6265a8511e58, which already enabled this behavior when an __await__ (that is awaited from a task) yielded None.
This commit is contained in:
parent
e8b4b6476c
commit
a64dcd7c5d
@ -624,8 +624,8 @@ do_python_task() {
|
|||||||
return DS_done;
|
return DS_done;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (result == Py_None && PyCoro_CheckExact(_generator)) {
|
} else if (result == Py_None) {
|
||||||
// Bare yield from a coroutine means to try again next frame.
|
// Bare yield means to continue next frame.
|
||||||
Py_DECREF(result);
|
Py_DECREF(result);
|
||||||
return DS_cont;
|
return DS_cont;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user