Skip to content
Snippets Groups Projects
Commit 72b5cb1f authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

fix a bug in CustomException

parent 9c432388
No related branches found
No related tags found
No related merge requests found
# v2.14.46
* added kwargs to ThreadCollection.from_class
* fixed a bug in CustomException
__version__ = '2.14.46a2'
__version__ = '2.14.46a3'
......@@ -26,8 +26,11 @@ class CustomException(Exception):
def __str__(self) -> str:
a = '%s(%s' % (self.__class__.__qualname__.split('.')[-1], ', '.join(map(repr, self.args)))
if self.kwargs:
a += ', ' + ', '.join(map(lambda k, v: '%s=%s' % (k, repr(v)), self.kwargs.items()))
try:
if self.kwargs:
a += ', ' + ', '.join(map(lambda k, v: '%s=%s' % (k, repr(v)), self.kwargs.items()))
except AttributeError:
pass
a += ')'
return a
......@@ -36,9 +39,12 @@ class CustomException(Exception):
if self.__class__.__module__ != 'builtins' else '',
self.__class__.__qualname__,
', '.join(map(repr, self.args)))
if self.kwargs:
a += ', ' + (', '.join(map(lambda kv: '%s=%s' % (kv[0], repr(kv[1])),
self.kwargs.items())))
try:
if self.kwargs:
a += ', ' + (', '.join(map(lambda kv: '%s=%s' % (kv[0], repr(kv[1])),
self.kwargs.items())))
except AttributeError:
pass
a += ')'
return a
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment