Fix __init__ for BaseException to be completely backwards-compatible for

'args'.
This commit is contained in:
Brett Cannon 2005-10-29 03:26:51 +00:00
parent 1070997d4f
commit ad551cb280
1 changed files with 3 additions and 5 deletions

View File

@ -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"""
self.message = message
self.args = ((message,) + args
if message != ''
else tuple())
self.args = args
self.message = args[0] if args else ''
def __str__(self):
"""Return the str of 'message'"""