Commits

Nicolas Grilly committed 8629a95

Merged Part.read_headers into Part.from_fp

Comments (0)

Files changed (1)

cherrypy/_cpreqbody.py

         self.value = None
     
     def from_fp(cls, fp, boundary):
-        headers = cls.read_headers(fp)
-        return cls(fp, headers, boundary)
-    from_fp = classmethod(from_fp)
-    
-    def read_headers(cls, fp):
         headers = httputil.HeaderMap()
+        
         while True:
             line = fp.readline()
             if not line:
                 v = ", ".join((existing, v))
             headers[k] = v
         
-        return headers
-    read_headers = classmethod(read_headers)
+        return cls(fp, headers, boundary)
+    from_fp = classmethod(from_fp)
     
     def read_lines_to_boundary(self, fp_out=None):
         """Read bytes from self.fp and return or write them to a file.