We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7513ab6 commit 38ac00fCopy full SHA for 38ac00f
README.md
@@ -46,19 +46,21 @@ if __name__ == "__main__":
46
## Example
47
48
```c
49
+#define PYAWAITABLE_PYAPI
50
#include <pyawaitable.h>
51
52
// Assuming that this is using METH_O
53
static PyObject *
54
hello(PyObject *self, PyObject *coro) {
55
// Make our awaitable object
- PyObject *awaitable = pyawaitable_new();
56
+ PyObject *awaitable = PyAwaitable_New();
57
- if (!awaitable)
58
+ if (awaitable == NULL) {
59
return NULL;
60
+ }
61
62
// Mark the coroutine for being awaited
- if (pyawaitable_await(awaitable, coro, NULL, NULL) < 0) {
63
+ if (PyAwaitable_AddAwait(awaitable, coro, NULL, NULL) < 0) {
64
Py_DECREF(awaitable);
65
66
}
0 commit comments