Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7e642e8

Browse files
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.
1 parent 83ff749 commit 7e642e8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Lib/CGIHTTPServer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import os
2525
import sys
26-
import string
2726
import urllib
2827
import BaseHTTPServer
2928
import SimpleHTTPServer
@@ -164,7 +163,7 @@ def run_cgi(self):
164163
env['CONTENT_LENGTH'] = length
165164
accept = []
166165
for line in self.headers.getallmatchingheaders('accept'):
167-
if line[:1] in string.whitespace:
166+
if line[:1] in "\t\n\r ":
168167
accept.append(line.strip())
169168
else:
170169
accept = accept + line[7:].split(',')

0 commit comments

Comments
 (0)