Skip to content

Commit

Permalink
BUG: Modify match words for catching error message (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
aresnow1 authored Jul 5, 2023
1 parent 7d2f12f commit de6e1e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/xoscar/backends/indigen/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ async def is_sub_pool_alive(self, process: multiprocessing.Process):
try:
return await asyncio.to_thread(process.is_alive)
except RuntimeError as ex: # pragma: no cover
if "cannot schedule new futures after interpreter shutdown" not in str(ex):
if "cannot schedule new futures" not in str(ex):
# when atexit is triggered, the default pool might be shutdown
# and to_thread will fail
raise
Expand Down
5 changes: 1 addition & 4 deletions python/xoscar/backends/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1408,10 +1408,7 @@ async def monitor_sub_pools(self):
except asyncio.CancelledError:
raise
except RuntimeError as ex: # pragma: no cover
if (
"cannot schedule new futures after interpreter shutdown"
not in str(ex)
):
if "cannot schedule new futures" not in str(ex):
# to silence log when process exit, otherwise it
# will raise "RuntimeError: cannot schedule new futures
# after interpreter shutdown".
Expand Down

0 comments on commit de6e1e1

Please sign in to comment.