Make synchronous generator from an asynchronous generator

Julien Salort listes at salort.eu
Fri Mar 16 13:43:42 EDT 2018


Le 16/03/2018 à 16:55, Ian Kelly a écrit :

> Note that this function can't be called more than once, because it
> closes the event loop at the end. Next time you call it it will get
> the closed event loop and try to schedule on it and then raise an
> exception because it's closed.
Ah ok.
So, if I replace get_event_loop() with new_event_loop(), then it's fine ?
> Well, it's not pretty, but this seems to work:
[...]

Thanks !

Julien



More information about the Python-list mailing list