MCPcopy Index your code
hub / github.com/RustPython/RustPython / remove

Method remove

Lib/mailbox.py:1041–1053  ·  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

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

Callers 15

executeNotebookFunction · 0.45
index.jsFile · 0.45
criterion_benchmarkFunction · 0.45
_c3_mroFunction · 0.45
waitMethod · 0.45
notifyMethod · 0.45
_get_revised_pathFunction · 0.45
do_helpMethod · 0.45
_remove_actionMethod · 0.45
_remove_actionMethod · 0.45
_remove_actionMethod · 0.45

Calls 4

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

Tested by 1