Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated request_param and match_param to use as_sorted_tuple

  • Loading branch information...
commit 4b8cf2d4e9711189e800dcb470a29773e4269f92 1 parent 5507b82
@mmerickel mmerickel authored
Showing with 3 additions and 7 deletions.
  1. +3 −7 pyramid/config/predicates.py
View
10 pyramid/config/predicates.py
@@ -64,10 +64,7 @@ def __call__(self, context, request):
class RequestParamPredicate(object):
def __init__(self, val, config):
- if not is_nonstr_iter(val):
- val = (val,)
- val = sorted(val)
- self.val = val
+ val = as_sorted_tuple(val)
reqs = []
for p in val:
k = p
@@ -76,6 +73,7 @@ def __init__(self, val, config):
k, v = p.split('=', 1)
k, v = k.strip(), v.strip()
reqs.append((k, v))
+ self.val = val
self.reqs = reqs
def text(self):
@@ -163,9 +161,7 @@ def __call__(self, context, request):
class MatchParamPredicate(object):
def __init__(self, val, config):
- if not is_nonstr_iter(val):
- val = (val,)
- val = sorted(val)
+ val = as_sorted_tuple(val)
self.val = val
reqs = [ p.split('=', 1) for p in val ]
self.reqs = [ (x.strip(), y.strip()) for x, y in reqs ]

0 comments on commit 4b8cf2d

Please sign in to comment.
Something went wrong with that request. Please try again.