MCPcopy Index your code
hub / github.com/python/cpython / set_content

Method set_content

Lib/email/contentmanager.py:31–38  ·  view source on GitHub ↗
(self, msg, obj, *args, **kw)

Source from the content-addressed store, hash-verified

29 self.set_handlers[typekey] = handler
30
31 def set_content(self, msg, obj, *args, **kw):
32 if msg.get_content_maintype() == 'multipart':
33 # XXX: is this error a good idea or not? We can remove it later,
34 # but we can't add it later, so do it for now.
35 raise TypeError("set_content not valid on multipart")
36 handler = self._find_set_handler(msg, obj)
37 msg.clear_content()
38 handler(msg, obj, *args, **kw)
39
40 def _find_set_handler(self, msg, obj):
41 full_path_for_error = None

Calls 4

_find_set_handlerMethod · 0.95
handlerFunction · 0.85
get_content_maintypeMethod · 0.80
clear_contentMethod · 0.80