From 9645152c2d7dde73a088a45499f28e28f3cd0e01 Mon Sep 17 00:00:00 2001
From: jmaslanka <jmaslanka@protonmail.com>
Date: Tue, 11 Mar 2025 15:16:19 +0100
Subject: [PATCH] fix __str__

---
 CHANGELOG.md          | 2 +-
 satella/exceptions.py | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index cbb487f2..fe5888aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,6 @@
 # v2.26.7
 
-* _TBA_
+* fixed `__str__` method of `CustomException`
 
 # v2.26.6
 
diff --git a/satella/exceptions.py b/satella/exceptions.py
index 9ac1a0ed..73c4ab62 100644
--- a/satella/exceptions.py
+++ b/satella/exceptions.py
@@ -29,7 +29,7 @@ class CustomException(Exception):
         a = '%s(%s' % (self.__class__.__qualname__.split('.')[-1], ', '.join(map(repr, self.args)))
         try:
             if self.kwargs:
-                a += ', ' + ', '.join(map(lambda k, v: '%s=%s' % (k, repr(v)), self.kwargs.items()))
+                a += ', ' + ', '.join('%s=%s' % (k, repr(v)) for k, v in self.kwargs.items())
         except AttributeError:
             pass
         a += ')'
@@ -42,8 +42,7 @@ class CustomException(Exception):
                          ', '.join(map(repr, self.args)))
         try:
             if self.kwargs:
-                a += ', ' + (', '.join(map(lambda kv: '%s=%s' % (kv[0], repr(kv[1])),
-                                           self.kwargs.items())))
+                a += ', ' + ', '.join('%s=%s' % (k, repr(v)) for k, v in self.kwargs.items())
         except AttributeError:
             pass
         a += ')'
-- 
GitLab