def parse_request_start_line(line):
 try:
  (method, path, version) = line.split(' ')
 except ValueError:
  raise HTTPInputError('Malformed HTTP request line')
 if (not re.match('^HTTP/1\\.[0-9]$', version)):
  raise HTTPInputError(('Malformed HTTP version in HTTP Request-Line: %r' % version))
 return RequestStartLine(method, path, version)

def parse_request_start_line ( line ) : try : ( method , path , version ) = line . split ( ' ' ) except ValueError : raise HTTPInputError ( 'Malformed HTTP request line' ) if ( not re . match ( '^HTTP/1\\.[0-9]$' , version ) ) : raise HTTPInputError ( ( 'Malformed HTTP version in HTTP Request-Line: %r' % version ) ) return RequestStartLine ( method , path , version )
returns a tuple for an http 1 .