From abd2dd149d3ebfeb40deafd9411c0c5a212368e5 Mon Sep 17 00:00:00 2001 From: "Vgr E. Barry" Date: Wed, 16 Nov 2016 08:20:02 -0500 Subject: [PATCH] Allow handle_error to decorate its instances --- src/decorators.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/decorators.py b/src/decorators.py index ac446e2..f85e8e0 100644 --- a/src/decorators.py +++ b/src/decorators.py @@ -161,6 +161,9 @@ class handle_error: if isinstance(func, cls) and instance is func.instance: # already decorated return func + if isinstance(func, cls): + func = func.func + self = super().__new__(cls) self.instance = instance self.func = func