MCPcopy Create free account
hub / github.com/conda/constructor / remove

Method remove

constructor/briefcase.py:404–418  ·  view source on GitHub ↗

Remove the root of the payload. This function requires some extra care due to the root directory being a cached property.

(self, *, ignore_errors: bool = True)

Source from the content-addressed store, hash-verified

402 return Path(tempfile.mkdtemp(prefix="payload-"))
403
404 def remove(self, *, ignore_errors: bool = True) -> None:
405 """Remove the root of the payload.
406
407 This function requires some extra care due to the root directory being a cached property.
408 """
409 root = getattr(self, "root", None)
410 if root is None:
411 return
412 shutil.rmtree(root, ignore_errors=ignore_errors)
413 # Now we drop the cached value so next access will recreate if desired
414 try:
415 delattr(self, "root")
416 except Exception:
417 # delattr on a cached_property may raise on some versions / edge cases
418 pass
419
420 def prepare(self) -> None:
421 """Prepares the payload.

Callers 6

createFunction · 0.95
test_payload_removeFunction · 0.95
_solve_precsFunction · 0.80
modify_xmlFunction · 0.80
_run_installer_msiFunction · 0.80
_run_uninstaller_msiFunction · 0.80

Calls

no outgoing calls

Tested by 3

test_payload_removeFunction · 0.76
_run_installer_msiFunction · 0.64
_run_uninstaller_msiFunction · 0.64