summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2024-01-27 17:07:16 -0700
committerMichael Merickel <michael@merickel.org>2024-01-27 17:07:16 -0700
commit8a9d78106fd3b6d6dc44fabd205ee2c58fffef08 (patch)
tree3b3e61b2309b87ee78a5eeb9fda9810c2b957d42
parent56fad7f1ba9ead433f60210958756c27a1e5d7f3 (diff)
downloadpyramid-8a9d78106fd3b6d6dc44fabd205ee2c58fffef08.tar.gz
pyramid-8a9d78106fd3b6d6dc44fabd205ee2c58fffef08.tar.bz2
pyramid-8a9d78106fd3b6d6dc44fabd205ee2c58fffef08.zip
remove derived predicates, again there is no point because they must take just one arg
-rw-r--r--src/pyramid/config/adapters.py14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/pyramid/config/adapters.py b/src/pyramid/config/adapters.py
index 7a73c17f8..08bfff142 100644
--- a/src/pyramid/config/adapters.py
+++ b/src/pyramid/config/adapters.py
@@ -45,17 +45,13 @@ class AdaptersConfiguratorMixin:
predlist = self.get_predlist('subscriber')
order, preds, phash = predlist.make(self, **predicates)
- derived_predicates = [self._derive_predicate(p) for p in preds]
- derived_subscriber = self._derive_subscriber(
- subscriber, derived_predicates
- )
+ derived_subscriber = self._derive_subscriber(subscriber, preds)
intr.update(
{
'phash': phash,
'order': order,
'predicates': preds,
- 'derived_predicates': derived_predicates,
'derived_subscriber': derived_subscriber,
}
)
@@ -75,12 +71,6 @@ class AdaptersConfiguratorMixin:
self.action(None, register, introspectables=(intr,))
return subscriber
- def _derive_predicate(self, predicate):
- def derived_predicate(*arg):
- return predicate(arg[0])
-
- return derived_predicate
-
def _derive_subscriber(self, subscriber, predicates):
if eventonly(subscriber):
@@ -114,7 +104,7 @@ class AdaptersConfiguratorMixin:
# with all args, the eventonly hack would not have been required.
# At this point, though, using .subscriptions and manual execution
# is not possible without badly breaking backwards compatibility.
- if all(predicate(*arg) for predicate in predicates):
+ if all(predicate(arg[0]) for predicate in predicates):
return derived_subscriber(*arg)
if hasattr(subscriber, '__name__'):