[Zope-dev] Pointless exception re-raising in DA.py

Andrew Bennetts andrew-zopedev at puzzling.org
Thu Mar 25 05:44:33 EST 2004


On Thu, Mar 25, 2004 at 10:23:27AM +0000, Chris Withers wrote:
> Dieter Maurer wrote:
> 
> >   try: DB__=dbc()
> >   except:
> >     exc_type, exc_value, trc = sys.exc_info()
> >     raise DatabaseError('%s is not connected to a database' % self.id,
> >                         exc_type,
> >			 exc_value), trc
> 
> I didn't know you could re-raise a traceback like this... where's tha 
> tsyntax documented?

In the language reference:
    http://www.python.org/doc/current/ref/raise.html

See also the sys.exc_info docs in the library reference:
    http://www.python.org/doc/current/lib/module-sys.html#l2h-331

-Andrew.




More information about the Zope-Dev mailing list