def delete(x):
    """
    Convenience method to delete file or directory.
    :param x: The filesystem object to delete.
    """
    if x.is_dir():
        try:
            x.rmdir()
        except (OSError,):
            return
    else:
        x.unlink()
