@@ -103,12 +103,12 @@ def is_python(self, path):
103103 def run_cgi (self ):
104104 """Execute a CGI script."""
105105 dir , rest = self .cgi_info
106- i = string .rfind (rest , '?' )
106+ i = rest .rfind ('?' )
107107 if i >= 0 :
108108 rest , query = rest [:i ], rest [i + 1 :]
109109 else :
110110 query = ''
111- i = string .find (rest , '/' )
111+ i = rest .find ('/' )
112112 if i >= 0 :
113113 script , rest = rest [:i ], rest [i :]
114114 else :
@@ -165,16 +165,16 @@ def run_cgi(self):
165165 accept = []
166166 for line in self .headers .getallmatchingheaders ('accept' ):
167167 if line [:1 ] in string .whitespace :
168- accept .append (string .strip (line ))
168+ accept .append (line .strip ())
169169 else :
170- accept = accept + string . split ( line [7 :], ',' )
171- env ['HTTP_ACCEPT' ] = string . joinfields ( accept , ',' )
170+ accept = accept + line [7 :]. split ( ',' )
171+ env ['HTTP_ACCEPT' ] = ',' . join ( accept )
172172 ua = self .headers .getheader ('user-agent' )
173173 if ua :
174174 env ['HTTP_USER_AGENT' ] = ua
175175 co = filter (None , self .headers .getheaders ('cookie' ))
176176 if co :
177- env ['HTTP_COOKIE' ] = string . join ( co , ', ' )
177+ env ['HTTP_COOKIE' ] = ', ' . join ( co )
178178 # XXX Other HTTP_* headers
179179 if not self .have_fork :
180180 # Since we're setting the env in the parent, provide empty
@@ -185,7 +185,7 @@ def run_cgi(self):
185185
186186 self .send_response (200 , "Script output follows" )
187187
188- decoded_query = string .replace (query , '+' , ' ' )
188+ decoded_query = query .replace ('+' , ' ' )
189189
190190 if self .have_fork :
191191 # Unix -- fork as we should
0 commit comments