[Python-checkins] r65519 - in python/trunk/Lib/wsgiref: handlers.py headers.py simple_server.py util.py
brett.cannon
python-checkins at python.org
Mon Aug 4 23:30:53 CEST 2008
Author: brett.cannon
Date: Mon Aug 4 23:30:53 2008
New Revision: 65519
Log:
Silence warnings under -3 triggered by wsgiref.
Modified:
python/trunk/Lib/wsgiref/handlers.py
python/trunk/Lib/wsgiref/headers.py
python/trunk/Lib/wsgiref/simple_server.py
python/trunk/Lib/wsgiref/util.py
Modified: python/trunk/Lib/wsgiref/handlers.py
==============================================================================
--- python/trunk/Lib/wsgiref/handlers.py (original)
+++ python/trunk/Lib/wsgiref/handlers.py Mon Aug 4 23:30:53 2008
@@ -17,12 +17,13 @@
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!
Modified: python/trunk/Lib/wsgiref/headers.py
==============================================================================
--- python/trunk/Lib/wsgiref/headers.py (original)
+++ python/trunk/Lib/wsgiref/headers.py Mon Aug 4 23:30:53 2008
@@ -63,7 +63,7 @@
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 @@
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,
Modified: python/trunk/Lib/wsgiref/simple_server.py
==============================================================================
--- python/trunk/Lib/wsgiref/simple_server.py (original)
+++ python/trunk/Lib/wsgiref/simple_server.py Mon Aug 4 23:30:53 2008
@@ -169,7 +169,7 @@
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()]
Modified: python/trunk/Lib/wsgiref/util.py
==============================================================================
--- python/trunk/Lib/wsgiref/util.py (original)
+++ python/trunk/Lib/wsgiref/util.py Mon Aug 4 23:30:53 2008
@@ -98,7 +98,7 @@
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 @@
'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"""
More information about the Python-checkins
mailing list