Singleton Class Exception

Ames Andreas Andreas.Ames at comergo.com
Mon Nov 13 13:25:03 EST 2006


> -----Original Message-----
> From: python-list-bounces+andreas.ames=comergo.com at python.org 
> [mailto:python-list-bounces+andreas.ames=comergo.com at python.or
> g] On Behalf Of Dan Lenski
> Sent: Monday, November 13, 2006 7:05 PM
> Subject: Re: Singleton Class Exception
> 
> dischdennis wrote:
> > the line "raise Singleton.__single" invokes in my class the 
> following
> > error:
> >
> > exceptions must be classes, instances, or strings (deprecated), not
> > PurchaseRequisitionController
> 
> Denis,
> Jason's explanation is correct!  You are trying to use the Singleton

I don't think so.  The op wrote that he uses 2.4.3.  So I guess, the 
problem is, that PurchaseRequisitionController inherits (directly or 
not) from 'object'.  Although new style classes are allowed as 
exceptions in 2.5, an additional requirement is, that the exception 
must inherit from BaseException (or must not be a new style class 
instance at all, as before).


cheers,

aa

-- 
Andreas Ames | Programmer | Comergo GmbH |
Voice:  +49 69 7505 3213 | ames AT avaya DOT com



More information about the Python-list mailing list