support/scripts/pkg-stats: fix Python 3.8 deprecation warning
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 19 Nov 2020 14:53:52 +0000 (15:53 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sun, 17 Jan 2021 14:32:05 +0000 (15:32 +0100)
commitffb262040500151261107321e0e7d2f8b4632bd8
tree9bcd2ae2900f61f9fcc08e854ccd67a7b95d8477
parent824032d16854ae3c0e6e67c534a7e8850199091a
support/scripts/pkg-stats: fix Python 3.8 deprecation warning

With Python 3.8, the following deprecation warnings are emitted:

/home/thomas/projets/buildroot/./support/scripts/pkg-stats:418: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.

/home/thomas/projets/buildroot/./support/scripts/pkg-stats:536: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.

The correct way to pass coroutines is to use asyncio.create_task(),
but this is rather new method (Python 3.7), and using it breaks
compatibility with older Python versions. As suggested at
https://docs.python.org/3/library/asyncio-task.html#asyncio.create_task,
use the more cryptic, but also more compatible asyncio.ensure_future()
method.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
support/scripts/pkg-stats