def clean_doc(doc):
    """Remove spurious end-lines and such from the doc-string specified in
    the comment preceding the C++-python functions.

    """
    # Replace regular enter (i.e. mere comment formatting in cpp file)
    # with space
    doc = doc.replace("\n", " ")

    # The removal can cause a "hard enter" (literal \n) to get an unintended
    # trailing space - trim those.
    doc = doc.replace("\\n ", "\\n")
    return '"%s"' % doc