File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,9 @@ def __exit__(
9494 try :
9595 # If an event loop is running, force users to use the async context manager
9696 asyncio .get_running_loop ()
97- < << << << HEAD
97+ raise RuntimeError (
98+ "LocalBackend used with 'with' inside a running event loop. Use 'async with LocalBackend()' instead."
99+ )
98100 except RuntimeError :
99101 # No event loop running; safe to close synchronously
100102 self ._close ()
@@ -110,17 +112,6 @@ async def __aexit__(
110112 ) -> None :
111113 await self .close ()
112114
113- async def __aenter__ (self ) -> Self :
114- return self
115-
116- async def __aexit__ (
117- self ,
118- exc_type : type [BaseException ] | None ,
119- exc : BaseException | None ,
120- tb : TracebackType | None ,
121- ) -> None :
122- await self .close ()
123-
124115 async def close (self ) -> None :
125116 """
126117 If running vLLM in a separate process, this will kill that process and close the communication threads.
You can’t perform that action at this time.
0 commit comments