Use get_running_loop instead of get_event_loop

asyncio.get_event_loop() is deprecated in Python 3.10+; use asyncio.get_running_loop() instead.
This commit is contained in:
Harry 2026-03-25 22:38:34 +08:00 committed by GitHub
parent a0b1222403
commit 1cf7953d68
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -349,7 +349,7 @@ class OpenSpace:
self._running = True
self._task_done.clear()
self._last_evolved_skills = [] # Reset per-execution tracking
start_time = asyncio.get_event_loop().time()
start_time = asyncio.get_running_loop().time()
# Use external task_id if provided, otherwise generate one
if task_id is None:
task_id = f"task_{uuid.uuid4().hex[:12]}"
@ -933,4 +933,4 @@ class OpenSpace:
if self._running:
status = "running"
backends = ", ".join(self.config.backend_scope) if self.config.backend_scope else "all"
return f"<OpenSpace(status={status}, backends={backends}, model={self.config.llm_model})>"
return f"<OpenSpace(status={status}, backends={backends}, model={self.config.llm_model})>"