[Zope] Monkey Patching Grief with Zope 2.9.4
Dieter Maurer
dieter at handshake.de
Tue Sep 26 14:11:34 EDT 2006
Mark Wilson wrote at 2006-9-26 15:33 +0100:
> ...
>We've been working on a Zope web app which has been built and running on Zope
>2.7.0 for over 2 years now. Recently I've been trying to move it to Zope
>2.9.4 but have encountered some severe difficulties with a couple (at least)
>of monkey patches that are essential to our app and which worked fine with
>the earlier version.
> ....
> PF2SpecialUser.PF2Superuser_allowed = SpecialUser.allowed
> # replace with our custom method
> SpecialUser.allowed = PF2SpecialUser.PF2SpecialUser_allowed
Add ".im_func" at the end of these lines.
"im_func" strips the "InstanceMethod" wrapper and gives you
the raw function (which unlike the "InstanceMethod" does not check
the "isinstance" property for the wrong class).
--
Dieter
More information about the Zope
mailing list