From: Eric S. Raymond Date: Fri, 9 Feb 2001 12:10:26 +0000 (+0000) Subject: Eliminate use of string.whitespace and a string import with it. X-Git-Tag: v2.1b1~447 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e642e82d3429d9b4f583ba0e81a27e5ea02d5ca;p=python Eliminate use of string.whitespace and a string import with it. Some of the characters (form feed, vertical tab) are not legal continuation characters anyway, so this was wrong as well as annoying. --- diff --git a/Lib/CGIHTTPServer.py b/Lib/CGIHTTPServer.py index 84cdf67068..d6afaa105f 100644 --- a/Lib/CGIHTTPServer.py +++ b/Lib/CGIHTTPServer.py @@ -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(',')