Fix __init__ for BaseException to be completely backwards-compatible for
'args'.
This commit is contained in:
parent
1070997d4f
commit
ad551cb280
|
@ -63,12 +63,10 @@ will cause the deprecation of the existing ``args`` attribute)::
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, message='', *args):
|
def __init__(self, *args):
|
||||||
"""Set 'message' and 'args' attribute"""
|
"""Set 'message' and 'args' attribute"""
|
||||||
self.message = message
|
self.args = args
|
||||||
self.args = ((message,) + args
|
self.message = args[0] if args else ''
|
||||||
if message != ''
|
|
||||||
else tuple())
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""Return the str of 'message'"""
|
"""Return the str of 'message'"""
|
||||||
|
|
Loading…
Reference in New Issue