def cleanup(self):
current = self.join('<STR_LIT>')<EOL>if not os.path.exists(current):<EOL><INDENT>LOGGER.debug('<STR_LIT>', current)<EOL>os.unlink(self.join('<STR_LIT>'))<EOL>self.current = None<EOL>try:<EOL><INDENT>self._update_current()<EOL><DEDENT>except PrefixNotFound:<EOL><INDENT>if not os.listdir(self.path):<EOL><INDENT>LOGGER.debug('<STR_LIT>', self.path)<EOL>os.rmdir(self.path)<EOL><DEDENT>else:<EOL><INDENT>raise MalformedWorkdir(<EOL>(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'<EOL>).format(self.path)<EOL>)<EOL><DEDENT><DEDENT><DEDENT>
Attempt to set a new current symlink if it is broken. If no other
prefixes exist and the workdir is empty, try to delete the entire
workdir.

Raises:
    :exc:`~MalformedWorkdir`: if no prefixes were found, but the
        workdir is not empty.