aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2020-11-19 15:53:52 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2021-01-19 15:22:33 +0100
commit689651a3fa719b9f081b67225171dd8e4f64cc0f (patch)
tree70f7e43c87ad802d2333dd05536ed40c600cdb36
parent21c2d104bc666d049ba0ef41ce52047bb1827d84 (diff)
downloadbuildroot-689651a3fa719b9f081b67225171dd8e4f64cc0f.tar.gz
buildroot-689651a3fa719b9f081b67225171dd8e4f64cc0f.tar.bz2
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> (cherry picked from commit ffb262040500151261107321e0e7d2f8b4632bd8) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rwxr-xr-xsupport/scripts/pkg-stats4
1 files changed, 2 insertions, 2 deletions
diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
index d9fb886305..1820fe6e7b 100755
--- a/support/scripts/pkg-stats
+++ b/support/scripts/pkg-stats
@@ -530,7 +530,7 @@ async def check_package_urls(packages):
async with aiohttp.ClientSession(connector=connector, trust_env=True) as sess:
packages = [p for p in packages if p.status['url'][0] == 'ok']
for pkg in packages:
- tasks.append(check_url_status(sess, pkg, len(packages)))
+ tasks.append(asyncio.ensure_future(check_url_status(sess, pkg, len(packages))))
await asyncio.wait(tasks)
@@ -648,7 +648,7 @@ async def check_package_latest_version(packages):
async with aiohttp.ClientSession(connector=connector, trust_env=True) as sess:
packages = [p for p in packages if p.has_valid_infra]
for pkg in packages:
- tasks.append(check_package_latest_version_get(sess, pkg, len(packages)))
+ tasks.append(asyncio.ensure_future(check_package_latest_version_get(sess, pkg, len(packages))))
await asyncio.wait(tasks)