[Zope-CMF] Re: monkey patching CMFCore.utils isn't working?!?

suresh suresh_vv at yahoo.com
Thu Jun 22 03:17:50 EDT 2006


Tres Seaver wrote:
> Florent Guillaume wrote:
>>
>> It might be possible to monkey patch only _checkPermission.func_code, 
>> which seems to work on simple tests, but I've never tried it in real 
>> life:
>>
>>  >>> def f(a):
>> ...     print a+1
>>
>>  >>> def g(b):
>> ...     print b+2
>>
>>  >>> f(0)
>> 1
>>  >>> f.func_code = g.func_code
>>  >>> f(0)
>> 2
> 
> Heh, I thought about that, and then decided that tha voodoo factor was 
> too high to suggest.
> 

This is voodoo at its best :) Will bookmark this for later!

-- 
Thank you and Cheers,

Suresh V.
CTO, ParTecs, Bangalore
http://www.partecs.com
Plone-Zope-Python Consulting



More information about the Zope-CMF mailing list