diff --git a/smpclient/__init__.py b/smpclient/__init__.py index a3dd488..b4c7564 100644 --- a/smpclient/__init__.py +++ b/smpclient/__init__.py @@ -27,6 +27,7 @@ import asyncio import logging +import traceback from hashlib import sha256 from types import TracebackType from typing import AsyncIterator, Final, Tuple, Type @@ -401,10 +402,10 @@ async def __aexit__( self, exc_type: Type[BaseException] | None, exc_value: BaseException | None, - traceback: TracebackType | None, + tb: TracebackType | None, ) -> None: if exc_value is not None: - logger.error(f"Exception in SMPClient: {exc_type=}, {exc_value=}, {traceback=}") + logger.error(f"Exception in SMPClient:\n{traceback.format_exc()}") await self.disconnect() @staticmethod