diff options
| -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 |
