diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-29 06:29:18 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-29 06:31:14 +0300 |
commit | 4f69dca547cf58f7a27dfa20699115e1171e84f1 (patch) | |
tree | 4873138de8f075a72ca0eaf565417aa85f63ad0c /release/scripts | |
parent | d808557d15dbf09401d8ab40c59ce69c89a2d041 (diff) |
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.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/modules/bl_app_override/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/release/scripts/modules/bl_app_override/__init__.py b/release/scripts/modules/bl_app_override/__init__.py index 66857701669..89cc8a0eb28 100644 --- a/release/scripts/modules/bl_app_override/__init__.py +++ b/release/scripts/modules/bl_app_override/__init__.py @@ -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": |