def METHOD_NAME(self, pathname):
    """Unmount previously mounted image."""
    # Don't try to unmount something we didn't mount.
    if pathname not in self.mounts:
        raise ProcessorError(f"{pathname} is not mounted")
    # Call hdiutil.
    try:
        proc = subprocess.Popen(
            ("/usr/bin/hdiutil", "detach", self.mounts[pathname]),
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            text=True,
        )
        (_, stderr) = proc.communicate()
    except OSError as err:
        raise ProcessorError(
            f"hdiutil execution failed with error code {err.errno}: {err.strerror}"
        )
    if proc.returncode != 0:
        raise ProcessorError(f"unmounting {pathname} failed: {stderr}")
    # Delete mount from mount list.
    del self.mounts[pathname]