I'm curious as to why you don't want to import SQLObjectNotFound. With SQLObjectNotFound in the except statement it's perfectly clear as to when you want the exception to be handled and when you don't. LookupError may cover other things in your try block and could cause bugs down the road.
On 1/5/06, Stephen Thorne <[EMAIL PROTECTED]> wrote: > > I've been seeing this in various places around turbogears and example > code, and I thought I'd just make a comment about it: > > "except SQLObjectNotFound:" > > Using sqlobject.SQLObjectNotFound isn't actually necessery. > SQLObjectNotFound extends LookupError, which is a builtin, so you can > just use > > try: > o = foo.byName(bar) > except LookupError: > raise cherrpy.HTTPRedirect, '/' > > should work. :) > -- > Regards, > Stephen Thorne > Development Engineer > > Scanned by the NetBox from NetBox Blue > (http://netboxblue.com/) > >

