fluentpython / example-code-2e

Example code for Fluent Python, 2nd edition (O'Reilly 2022)
https://amzn.to/3J48u2J
MIT License
3.17k stars 902 forks source link

Fix `error` variable not being reset when failure in a coroutine call in flags2_asyncio.py #35

Open charlielito opened 1 year ago

charlielito commented 1 year ago

In the asyncio example in flags2_asyncio.py there is a bug when a call to a coroutine in the loop fails and the next one has success, the error variable doesn't get reset and it still thinks it got an error, and updates the counter[status] with the wrong value