Wiki

Clone wiki

compatibility / cheetah

As of 2.4.4, Cheetah does not run out-of-the-box. To get it to work with PyPy, a one-line change is necessary to Template.py:

--- cheetah/Template.py.~1~ 2010-12-12 21:38:34.000000000 -0600 +++ cheetah/Template.py 2013-02-06 18:42:48.000000000 -0600 @@ -996,7 +996,7 @@ setattr(concreteTemplateClass, attrname, attrVal)

     if (not hasattr(concreteTemplateClass, '__str__')
  • or concreteTemplateClass.str is object.str):
  • or concreteTemplateClass.str == object.str):

         mainMethNameAttr = '_mainCheetahMethod_for_'+concreteTemplateClass.__name__
         mainMethName = getattr(concreteTemplateClass, mainMethNameAttr, None)
    

After making that change, you get a complaint about the missing _namemapper extension module, but it seems to work.

Updated