[Zope3-dev] Re: TALES PathExpr doesn't call old style classes

dev at projekt01.ch dev at projekt01.ch
Wed May 24 18:47:28 EDT 2006


Hi Philipp, Florent

[...]
> > There *is* a way to check whether the error resulted from 
> the current 
> > frame or a lower frame. Introspections like these have the 
> tendency to 
> > be or become hacks, but then again, we use frame 
> inspections in other 
> > places, too.
> 
> Yes, I was about to suggest using the standard PJE trick used 
> elsewhere in Zope 3 (to check for deep ImportErrors), namely:
> 
> try:
>    ob()
> except (TypeError, AttributeError):
>    if sys.exce_info()[2].tb_next is not None:
>      raise
>    # here we know the exception was not "deep"
>    # so the object isn't callable

Good point

Regards
Roger Ineichen

> Florent



More information about the Zope3-dev mailing list