From 7311f651504075e49eb6852b52007f99a53457a5 Mon Sep 17 00:00:00 2001 From: Stuart Gathman <stuart@gathman.org> Date: Thu, 4 Jun 2009 22:02:09 +0000 Subject: [PATCH] Set milter_protocol attribute of noreply wrapper --- Milter/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Milter/__init__.py b/Milter/__init__.py index f0406da..6ec5bdc 100755 --- a/Milter/__init__.py +++ b/Milter/__init__.py @@ -46,7 +46,7 @@ def nocallback(func): def noreply(func): try: - nr_mask = func.milter_protocol = OPTIONAL_CALLBACKS[func.__name__][0] + nr_mask = OPTIONAL_CALLBACKS[func.__name__][0] except KeyErro: raise ValueError( '@noreply applied to non-optional method: '+func.__name__) @@ -54,6 +54,7 @@ def noreply(func): rc = func(self,*args) if self._protocol & nr_mask: return NOREPLY return rc + wrapper.milter_protocol = nr_mask return wrapper class DisabledAction(RuntimeError): -- GitLab