Fix 'bl_app_override' wrapping multiple times.

Calling `SomeClass.draw(self, context)` instead of `self.draw()`
would try to wrap the argument `self` multiple times, causing an error.
This commit is contained in:
Campbell Barton 2017-03-29 14:29:18 +11:00
parent d808557d15
commit 4f69dca547

@ -147,10 +147,12 @@ def ui_draw_filter_register(
return super().operator(*args, **kw)
def draw_override(func_orig, self_real, context):
# simple, no wrapping
# return func_orig(self_wrap, context)
cls_real = self_real.__class__
if cls_real is super:
# simple, no wrapping
return func_orig(self_real, context)
class Wrapper(self_real.__class__):
class Wrapper(cls_real):
__slots__ = ()
def __getattribute__(self, attr):
if attr == "layout":