diff options
author | Guido van Rossum <guido@python.org> | 2007-07-03 16:46:40 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-03 16:46:40 (GMT) |
commit | 0c41e887bd722aa08f45fc3387f24cf39e7f8c4b (patch) | |
tree | 370303f4a4bcfb462e90c80b5ff78a897b2bdac5 /Lib/Cookie.py | |
parent | 99c0c223e297866b55920dc1f15bade93004c5f9 (diff) | |
download | cpython-0c41e887bd722aa08f45fc3387f24cf39e7f8c4b.zip cpython-0c41e887bd722aa08f45fc3387f24cf39e7f8c4b.tar.gz cpython-0c41e887bd722aa08f45fc3387f24cf39e7f8c4b.tar.bz2 |
Fix test_cookie after filter() behavior change.
Diffstat (limited to 'Lib/Cookie.py')
-rw-r--r-- | Lib/Cookie.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/Cookie.py b/Lib/Cookie.py index 0cd3244..52a766d 100644 --- a/Lib/Cookie.py +++ b/Lib/Cookie.py @@ -312,7 +312,7 @@ def _quote(str, LegalChars=_LegalChars): # the string in doublequotes and precede quote (with a \) # special characters. # - if len(filter(LegalChars.__contains__, str)) == len(str): + if all(c in LegalChars for c in str): return str else: return '"' + _nulljoin( map(_Translator.get, str, str) ) + '"' @@ -442,7 +442,7 @@ class Morsel(dict): # Second we make sure it only contains legal characters if key.lower() in self._reserved: raise CookieError("Attempt to set a reserved key: %s" % key) - if len(filter(LegalChars.__contains__, key)) != len(key): + if any(c not in LegalChars for c in key): raise CookieError("Illegal key value: %s" % key) # It's a good key, so save it. |