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