diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2023-11-03 08:26:29 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-11-09 17:33:03 +0000 |
commit | 66bcf57bfeabe93f5716f045cf7731ffdf1c65db (patch) | |
tree | 85ee8d6ede09349b38d05b8b4c70b3edb335bf51 /bitbake | |
parent | dabed6288ad0b4593872bd71117b2ebb4eee1ae4 (diff) | |
download | poky-66bcf57bfeabe93f5716f045cf7731ffdf1c65db.tar.gz |
bitbake: asyncrpc: client: Prevent double closing of loop
Invalidate the loop in the client close() call so that it is not closed
twice (which is an error in the asyncio code)
(Bitbake rev: ef22f8ee82c242383625f078baafb629e45dad7e)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/asyncrpc/client.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/bitbake/lib/bb/asyncrpc/client.py b/bitbake/lib/bb/asyncrpc/client.py index d27dbf7121..628b90ee05 100644 --- a/bitbake/lib/bb/asyncrpc/client.py +++ b/bitbake/lib/bb/asyncrpc/client.py | |||
@@ -161,10 +161,12 @@ class Client(object): | |||
161 | self.client.max_chunk = value | 161 | self.client.max_chunk = value |
162 | 162 | ||
163 | def close(self): | 163 | def close(self): |
164 | self.loop.run_until_complete(self.client.close()) | 164 | if self.loop: |
165 | if sys.version_info >= (3, 6): | 165 | self.loop.run_until_complete(self.client.close()) |
166 | self.loop.run_until_complete(self.loop.shutdown_asyncgens()) | 166 | if sys.version_info >= (3, 6): |
167 | self.loop.close() | 167 | self.loop.run_until_complete(self.loop.shutdown_asyncgens()) |
168 | self.loop.close() | ||
169 | self.loop = None | ||
168 | 170 | ||
169 | def __enter__(self): | 171 | def __enter__(self): |
170 | return self | 172 | return self |