[Zope-Coders] Re: Catalog.py

Chris McDonough chrism@zope.com
04 Feb 2003 11:24:50 -0500


On Tue, 2003-02-04 at 11:19, Andreas Jung wrote:
> try:
>     from DocumentTemplate.cDocumentTemplate import safe_callable
> except:
> 
>     def safe_callable(ob):
>         # Works with ExtensionClasses and Acquisition.
>         if hasattr(ob, '__class__'):
>             if hasattr(ob, '__call__'):
>                 return 1
>             else:
>                 return type(ob) in ClassTypes
                                     ^^^^^^^^^^
>         else:
>             return callable(ob)
> 
> I can not see anything wrong with this code?

Offending line underscored.  ClassTypes is not defined previously.

- C