/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Brian M. Carlson
  • Date: 2006-04-27 00:11:21 UTC
  • mto: (1913.2.1 bzr.mbp.python25)
  • mto: This revision was merged to the branch mainline in revision 2030.
  • Revision ID: sandals@crustytoothpaste.ath.cx-20060427001121-e0e728124aebfcb1
Add a workaround for usage of the args attribute in exceptions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
 
75
75
 
76
76
class BzrError(StandardError):
 
77
    def __init__(self, *args):
 
78
        if not hasattr(self, 'args'):
 
79
            self.args = args
 
80
 
77
81
    def __str__(self):
78
82
        # XXX: Should we show the exception class in 
79
83
        # exceptions that don't provide their own message?  
97
101
    # base classes should override the docstring with their human-
98
102
    # readable explanation
99
103
 
100
 
    def __init__(self, **kwds):
 
104
    def __init__(self, *args, **kwds):
 
105
        # XXX: Use the underlying BzrError to always generate the args attribute
 
106
        # if it doesn't exist. --bmc, 20060426
 
107
        super(BzrError, self).__init__(*args)
101
108
        for key, value in kwds.items():
102
109
            setattr(self, key, value)
103
110