Skip to content

Commit

Permalink
Fix task bug in python 3.9 (#7961)
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyaboulton committed Apr 8, 2024
1 parent b78129d commit eae97c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/twenty-paws-poke.md
@@ -0,0 +1,5 @@
---
"gradio": patch
---

feat:Fix task bug in python 3.9
2 changes: 1 addition & 1 deletion gradio/route_utils.py
Expand Up @@ -795,7 +795,7 @@ async def _delete_state_handler(app: App):
"""When the server launches, regularly delete expired state."""
# The stop event needs to get the current event loop for python 3.8
# but the loop parameter is deprecated for 3.8+
if sys.version_info < (3, 9):
if sys.version_info < (3, 10):
loop = asyncio.get_running_loop()
app.stop_event = asyncio.Event(loop=loop)
asyncio.create_task(_delete_state(app))
Expand Down

0 comments on commit eae97c2

Please sign in to comment.