Drop support for Python 3.7, refs #2097

This commit is contained in:
Simon Willison 2023-07-08 11:40:19 -07:00
commit 2fd871a906
8 changed files with 13 additions and 18 deletions

View file

@ -1072,15 +1072,13 @@ class Datasette:
{"name": t.name, "ident": t.ident, "daemon": t.daemon} for t in threads
],
}
# Only available in Python 3.7+
if hasattr(asyncio, "all_tasks"):
tasks = asyncio.all_tasks()
d.update(
{
"num_tasks": len(tasks),
"tasks": [_cleaner_task_str(t) for t in tasks],
}
)
tasks = asyncio.all_tasks()
d.update(
{
"num_tasks": len(tasks),
"tasks": [_cleaner_task_str(t) for t in tasks],
}
)
return d
def _actor(self, request):