Hacker News new | ask | show | jobs
by zeronone 2145 days ago
Indentation is wrong in following statement ``` return once_wrapper ```
1 comments

Duh, thanks! Now I have a new one but I think it just means the script needs to stay running longer so the coroutine can have time to do its thing.

    ./once.py:29: RuntimeWarning: coroutine 'once.
    <locals>.once_wrapper' was never awaited
    one_time_setup()
Your main function needs to be async as well, since the one_time_setup is async. Linking this SO answer that also links to the docs (may come handy!).

https://stackoverflow.com/questions/57399157/runtimewarning-...

Edit: Also tangentially relevant is the article linked by pansa2 in another thread, which was also discussed on HN a few months ago: http://journal.stuffwithstuff.com/2015/02/01/what-color-is-y...

Thanks!