MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / remove

Method remove

tools/python-3.11.9-amd64/Lib/mailbox.py:985–997  ·  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

983 return new_key
984
985 def remove(self, key):
986 """Remove the keyed message; raise KeyError if it doesn't exist."""
987 path = os.path.join(self._path, str(key))
988 try:
989 f = open(path, 'rb+')
990 except OSError as e:
991 if e.errno == errno.ENOENT:
992 raise KeyError('No message with key: %s' % key)
993 else:
994 raise
995 else:
996 f.close()
997 os.remove(path)
998
999 def __setitem__(self, key, message):
1000 """Replace the keyed message; raise KeyError if it doesn't exist."""

Callers 15

_c3_mroFunction · 0.45
compile_fileFunction · 0.45
waitMethod · 0.45
notifyMethod · 0.45
_get_revised_pathFunction · 0.45
do_helpMethod · 0.45
onkeyMethod · 0.45
onkeypressMethod · 0.45
_clearstampMethod · 0.45
_undogotoMethod · 0.45
_undoMethod · 0.45
_remove_actionMethod · 0.45

Calls 4

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

Tested by

no test coverage detected