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

clearer

parent 83fb083f
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,8 @@ class rethrow_as(object):
# You can also provide just two exceptions
if len(pairs) == 2 and not isinstance(pairs[1], (tuple, list)) \
and all(issubclass(p, BaseException) for p in pairs[0]) \
and issubclass(pairs[1], (BaseException, type(None))):
and (pairs[1] is None or
issubclass(pairs[1], BaseException)):
self.mapping = [pairs]
else:
self.mapping = list(pairs)
......
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