Commit 7e642e82 authored by Eric S. Raymond's avatar Eric S. Raymond

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.
parent 83ff7498
...@@ -23,7 +23,6 @@ __all__ = ["CGIHTTPRequestHandler"] ...@@ -23,7 +23,6 @@ __all__ = ["CGIHTTPRequestHandler"]
import os import os
import sys import sys
import string
import urllib import urllib
import BaseHTTPServer import BaseHTTPServer
import SimpleHTTPServer import SimpleHTTPServer
...@@ -164,7 +163,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): ...@@ -164,7 +163,7 @@ class CGIHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
env['CONTENT_LENGTH'] = length env['CONTENT_LENGTH'] = length
accept = [] accept = []
for line in self.headers.getallmatchingheaders('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()) accept.append(line.strip())
else: else:
accept = accept + line[7:].split(',') accept = accept + line[7:].split(',')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment