diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-08-04 21:30:53 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-08-04 21:30:53 (GMT) |
commit | d250c8d666a53c14aee59e4c5e454a2fbb514ae5 (patch) | |
tree | f5dc0a3506a33730a29a5b2b39cf2da1ed6a6f2e /Lib/wsgiref | |
parent | b646757e01d51c242eef2f9802f1ca6836a5804a (diff) | |
download | cpython-d250c8d666a53c14aee59e4c5e454a2fbb514ae5.zip cpython-d250c8d666a53c14aee59e4c5e454a2fbb514ae5.tar.gz cpython-d250c8d666a53c14aee59e4c5e454a2fbb514ae5.tar.bz2 |
Silence warnings under -3 triggered by wsgiref.
Diffstat (limited to 'Lib/wsgiref')
-rw-r--r-- | Lib/wsgiref/handlers.py | 13 | ||||
-rw-r--r-- | Lib/wsgiref/headers.py | 4 | ||||
-rw-r--r-- | Lib/wsgiref/simple_server.py | 2 | ||||
-rw-r--r-- | Lib/wsgiref/util.py | 4 |
4 files changed, 12 insertions, 11 deletions
diff --git a/Lib/wsgiref/handlers.py b/Lib/wsgiref/handlers.py index 099371b..173e34c 100644 --- a/Lib/wsgiref/handlers.py +++ b/Lib/wsgiref/handlers.py @@ -17,12 +17,13 @@ except NameError: d[k] = v return d -try: - True - False -except NameError: - True = not None - False = not True +# Uncomment for 2.2 compatibility. +#try: +# True +# False +#except NameError: +# True = not None +# False = not True # Weekday and month names for HTTP date/time formatting; always English! diff --git a/Lib/wsgiref/headers.py b/Lib/wsgiref/headers.py index 016eb86..3169acf 100644 --- a/Lib/wsgiref/headers.py +++ b/Lib/wsgiref/headers.py @@ -63,7 +63,7 @@ class Headers: Does *not* raise an exception if the header is missing. """ name = name.lower() - self._headers[:] = [kv for kv in self._headers if kv[0].lower()<>name] + self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name] def __getitem__(self,name): """Get the first header value for 'name' @@ -142,7 +142,7 @@ class Headers: return self._headers[:] def __repr__(self): - return "Headers(%s)" % `self._headers` + return "Headers(%r)" % self._headers def __str__(self): """str() returns the formatted headers, complete with end line, diff --git a/Lib/wsgiref/simple_server.py b/Lib/wsgiref/simple_server.py index 95996cc..1b0a4b2 100644 --- a/Lib/wsgiref/simple_server.py +++ b/Lib/wsgiref/simple_server.py @@ -169,7 +169,7 @@ def demo_app(environ,start_response): print >>stdout h = environ.items(); h.sort() for k,v in h: - print >>stdout, k,'=',`v` + print >>stdout, k,'=', repr(v) start_response("200 OK", [('Content-Type','text/plain')]) return [stdout.getvalue()] diff --git a/Lib/wsgiref/util.py b/Lib/wsgiref/util.py index 9009b87..450a32f 100644 --- a/Lib/wsgiref/util.py +++ b/Lib/wsgiref/util.py @@ -98,7 +98,7 @@ def shift_path_info(environ): return None path_parts = path_info.split('/') - path_parts[1:-1] = [p for p in path_parts[1:-1] if p and p<>'.'] + path_parts[1:-1] = [p for p in path_parts[1:-1] if p and p != '.'] name = path_parts[1] del path_parts[1] @@ -166,7 +166,7 @@ _hoppish = { 'connection':1, 'keep-alive':1, 'proxy-authenticate':1, 'proxy-authorization':1, 'te':1, 'trailers':1, 'transfer-encoding':1, 'upgrade':1 -}.has_key +}.__contains__ def is_hop_by_hop(header_name): """Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header""" |