exception message output problem
Russ P.
Russ.Paielli at gmail.com
Fri Dec 21 18:52:58 EST 2007
More information about the Python-list mailing list
Fri Dec 21 18:52:58 EST 2007
- Previous message (by thread): mac dashboad
- Next message (by thread): exception message output problem
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Dec 21, 2:58 pm, Lie <Lie.1... at gmail.com> wrote: > Change the exception into this: > class InconsistentUnits(Exception): > def __init__(self, args=""): self.args = (args,) > # Python have an odd (read: broken) singleton implementation > # single member tuple must have a comma behind it Hey, that worked. Thanks. Actually, the parens aren't needed, so this works too: def __init__(self, args=""): self.args = args, The trailing comma wasn't necessary a while back (pre 2.5?), so something in Python must have changed. I'd say that it looks a bit cleaner without the trailing comma, so maybe whatever changed should get changed back.
- Previous message (by thread): mac dashboad
- Next message (by thread): exception message output problem
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list