diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-04-17 08:48:32 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-04-17 08:48:32 (GMT) |
commit | 9d72bb452bced3a100f07f8a9e30c4495a9ec41a (patch) | |
tree | c39762a764fcc16f2cfc42e2504e58ff31e159e6 /Lib/Cookie.py | |
parent | ff11334927ee616d765b54a3851016b76a20bcec (diff) | |
download | cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.zip cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.tar.gz cpython-9d72bb452bced3a100f07f8a9e30c4495a9ec41a.tar.bz2 |
Remove functions in string module that are also string methods. Also remove:
* all calls to functions in the string module (except maketrans)
* everything from stropmodule except for maketrans() which is still used
Diffstat (limited to 'Lib/Cookie.py')
-rw-r--r-- | Lib/Cookie.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/Cookie.py b/Lib/Cookie.py index 368a3bb..4a34ff4 100644 --- a/Lib/Cookie.py +++ b/Lib/Cookie.py @@ -307,15 +307,14 @@ _Translator = { _idmap = ''.join(chr(x) for x in xrange(256)) -def _quote(str, LegalChars=_LegalChars, - idmap=_idmap, translate=string.translate): +def _quote(str, LegalChars=_LegalChars, idmap=_idmap): # # If the string does not need to be double-quoted, # then just return the string. Otherwise, surround # the string in doublequotes and precede quote (with a \) # special characters. # - if "" == translate(str, idmap, LegalChars): + if "" == str.translate(idmap, LegalChars): return str else: return '"' + _nulljoin( map(_Translator.get, str, str) ) + '"' @@ -440,14 +439,12 @@ class Morsel(dict): return K.lower() in self._reserved # end isReservedKey - def set(self, key, val, coded_val, - LegalChars=_LegalChars, - idmap=_idmap, translate=string.translate): + def set(self, key, val, coded_val, LegalChars=_LegalChars, idmap=_idmap): # First we verify that the key isn't a reserved word # 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 "" != translate(key, idmap, LegalChars): + if "" != key.translate(idmap, LegalChars): raise CookieError("Illegal key value: %s" % key) # It's a good key, so save it. |