[Zope-Coders] Re: Catalog.py

Andreas Jung andreas@andreas-jung.com
Tue, 04 Feb 2003 17:37:55 +0100


Fixed for 2.5, 2.6, HEAD.

Thanks for having open eyes ;-)
Andreas

--On Dienstag, 4. Februar 2003 11:24 -0500 Chris McDonough 
<chrism@zope.com> wrote:

> 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
>
>
>
> _______________________________________________
> Zope-Coders mailing list
> Zope-Coders@zope.org
> http://mail.zope.org/mailman/listinfo/zope-coders




    ---------------------------------------------------------------------
   -    Andreas Jung                     http://www.andreas-jung.com   -
  -   EMail: andreas at andreas-jung.com                              -
   -            "Life is too short to (re)write parsers"               -
    ---------------------------------------------------------------------