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

Method remove

Lib/mailbox.py:1048–1060  ·  view source on GitHub ↗

Remove the keyed message; raise KeyError if it doesn't exist.

(self, key)

Source from the content-addressed store, hash-verified

1046 return new_key
1047
1048 def remove(self, key):
1049 """Remove the keyed message; raise KeyError if it doesn't exist."""
1050 path = os.path.join(self._path, str(key))
1051 try:
1052 f = open(path, 'rb+')
1053 except OSError as e:
1054 if e.errno == errno.ENOENT:
1055 raise KeyError('No message with key: %s' % key)
1056 else:
1057 raise
1058 else:
1059 f.close()
1060 os.remove(path)
1061
1062 def __setitem__(self, key, message):
1063 """Replace the keyed message; raise KeyError if it doesn't exist."""

Callers 15

highlightLineMethod · 0.45
destroyMethod · 0.45
popFrameMethod · 0.45
_updateMissedCountMethod · 0.45
showImpactEffectMethod · 0.45
_togglePlayPauseMethod · 0.45
_handleResetMethod · 0.45
destroyMethod · 0.45
triggerSamplingEffectMethod · 0.45
deltreeFunction · 0.45
_c3_mroFunction · 0.45

Calls 4

strFunction · 0.85
openFunction · 0.70
joinMethod · 0.45
closeMethod · 0.45

Tested by 1

_unpack_srcMethod · 0.36