Skip to content

Commit

Permalink
Don't use shutdown_default_executor for Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrm-nvidia committed Nov 14, 2024
1 parent f9b2566 commit 5eabfb0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytriton/proxy/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ def run(self):
try:
_cancel_all_tasks(self._loop)
self._loop.run_until_complete(self._loop.shutdown_asyncgens())
self._loop.run_until_complete(self._loop.shutdown_default_executor())
# shutdown default executor was introduced in Python 3.9
if hasattr(self._loop, "shutdown_default_executor"):
self._loop.run_until_complete(self._loop.shutdown_default_executor())
finally:
asyncio.set_event_loop(None)
self._loop.close()
Expand Down

0 comments on commit 5eabfb0

Please sign in to comment.