MCPcopy Create free account
hub / github.com/bugy/script-server / on_rm_error

Function on_rm_error

src/tests/test_utils.py:94–102  ·  view source on GitHub ↗
(func, path, exc_info)

Source from the content-addressed store, hash-verified

92 exception = None
93
94 def on_rm_error(func, path, exc_info):
95 try:
96 os.chmod(path, stat.S_IWRITE | stat.S_IEXEC | stat.S_IREAD)
97 os.remove(path)
98 except Exception as e:
99 print('Failed to remove path ' + path + ': ' + str(e))
100 nonlocal exception
101 if exception is None:
102 exception = e
103
104 shutil.rmtree(folder, onerror=on_rm_error)
105 if exception:

Callers

nothing calls this directly

Calls 1

removeMethod · 0.80

Tested by

no test coverage detected