Parse all remaining data and return the root message object.
(self)
| 182 | pass |
| 183 | |
| 184 | def close(self): |
| 185 | """Parse all remaining data and return the root message object.""" |
| 186 | self._input.close() |
| 187 | self._call_parse() |
| 188 | root = self._pop_message() |
| 189 | assert not self._msgstack |
| 190 | # Look for final set of defects |
| 191 | if root.get_content_maintype() == 'multipart' \ |
| 192 | and not root.is_multipart() and not self._headersonly: |
| 193 | defect = errors.MultipartInvariantViolationDefect() |
| 194 | self.policy.handle_defect(root, defect) |
| 195 | return root |
| 196 | |
| 197 | def _new_message(self): |
| 198 | if self._old_style_factory: |