Skip to content

Commit 0878ab4

Browse files
committed
fix(local): resolve merge conflict markers and finalize async context manager (__aenter__/__aexit__) for LocalBackend
1 parent 9867e8e commit 0878ab4

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/art/local/backend.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)