Skip to content

Commit 6f86056

Browse files
committed
Merge remote-tracking branch 'upstream/main' into improving-ci-coverage-and-configuring-.coveragerc
2 parents 75c2fe4 + 1627c75 commit 6f86056

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/ogx/core/library_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,12 @@ async def _consume() -> None:
323323
await asyncio.sleep(0.01)
324324
finally:
325325
if async_gen is not None:
326-
await async_gen.aclose()
326+
if hasattr(async_gen, "aclose"):
327+
await async_gen.aclose()
328+
elif hasattr(async_gen, "close"):
329+
close = async_gen.close()
330+
if asyncio.iscoroutine(close):
331+
await close
327332

328333
future = asyncio.run_coroutine_threadsafe(_consume(), self.loop)
329334

0 commit comments

Comments
 (0)