diff options
| author | Chris McDonough <chrism@plope.com> | 2012-08-25 02:33:27 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2012-08-25 02:33:27 -0400 |
| commit | 3c820fcfbf80621ea07cd9599b02cf95e5faf3c0 (patch) | |
| tree | 529ebf6248957d48f4698349387ed0678c6081e3 | |
| parent | cc33a518a124883a41cadba13fb3dc4d07dfd43d (diff) | |
| download | pyramid-3c820fcfbf80621ea07cd9599b02cf95e5faf3c0.tar.gz pyramid-3c820fcfbf80621ea07cd9599b02cf95e5faf3c0.tar.bz2 pyramid-3c820fcfbf80621ea07cd9599b02cf95e5faf3c0.zip | |
rant
| -rw-r--r-- | pyramid/config/adapters.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pyramid/config/adapters.py b/pyramid/config/adapters.py index 01438fd30..e9b0df614 100644 --- a/pyramid/config/adapters.py +++ b/pyramid/config/adapters.py @@ -70,6 +70,17 @@ class AdaptersConfiguratorMixin(object): if not predicates: return subscriber def subscriber_wrapper(*arg): + # We need to accept *arg and pass it along because zope + # subscribers are designed poorly. Notification will always call + # an associated subscriber with all of the objects involved in + # the subscription lookup, despite the fact that the event sender + # always has the option to attach those objects to the event + # object itself (and usually does). It would be much saner if the + # registry just used extra args passed to notify to do the lookup + # but only called event subscribers with the actual event object, + # or if we had been smart enough early on to always wrap + # subscribers in something that threw away the extra args, but + # c'est la vie. if all((predicate(*arg) for predicate in predicates)): return subscriber(*arg) if hasattr(subscriber, '__name__'): |
