diff --git a/libs/core/langchain_core/runnables/config.py b/libs/core/langchain_core/runnables/config.py index 84d3b6cc1fd..fc58fd154df 100644 --- a/libs/core/langchain_core/runnables/config.py +++ b/libs/core/langchain_core/runnables/config.py @@ -207,7 +207,8 @@ class ConfigContext: RuntimeError: If the context manager was not entered. """ if not self._entered: - raise RuntimeError("Cannot exit context manager that was not entered") + msg = "Cannot exit context manager that was not entered" + raise RuntimeError(msg) if self._ctx is not None and self._config_token is not None: self._ctx.run(var_child_runnable_config.reset, self._config_token) @@ -671,3 +672,4 @@ async def run_in_executor( return await asyncio.get_running_loop().run_in_executor(executor_or_config, wrapper) +