]> granicus.if.org Git - python/commitdiff
Eliminate use of string.whitespace and a string import with it.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 9 Feb 2001 12:10:26 +0000 (12:10 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 9 Feb 2001 12:10:26 +0000 (12:10 +0000)
Some of the characters (form feed, vertical tab) are not
legal continuation characters anyway, so this was wrong as
well as annoying.

Lib/CGIHTTPServer.py

index 84cdf67068e1948720afdedd1d041cdc7ae2ec1a..d6afaa105f3a0f72f70e2b33309969c4a5e373ff 100644 (file)
@@ -23,7 +23,6 @@ __all__ = ["CGIHTTPRequestHandler"]
 
 import os
 import sys
-import string
 import urllib
 import BaseHTTPServer
 import SimpleHTTPServer
@@ -164,7 +163,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
             env['CONTENT_LENGTH'] = length
         accept = []
         for line in self.headers.getallmatchingheaders('accept'):
-            if line[:1] in string.whitespace:
+            if line[:1] in "\t\n\r ":
                 accept.append(line.strip())
             else:
                 accept = accept + line[7:].split(',')