def pystr(v_str):
    """Convert string repr of Fortran string to Python string."""
    assert isinstance(v_str, str)
    if v_str[0] in ("'", '"') and v_str[0] == v_str[-1]:
        quote = v_str[0]
        out = v_str[1:-1]
    else:
        quote = None
        out = v_str
    if quote:
        out = out.replace(2 * quote, quote)
    return out
