Skip to content

"SyntaxWarning: invalid escape sequence '\\*'\n" in strip_comments #27

@cygerior

Description

@cygerior

Python 3.12+ throws SyntaxWarning when detectig invalid sequence in regular expressions. in fdt/misc.py - line 66 :

def strip_comments(text):
text = re.sub('//.?(\r\n?|\n)|/*.?*/', '\n', text, flags=re.S)
return text

shall use r'..' instead of '...' and therefore be replaced by:

def strip_comments(text):
text = re.sub(r'//.?(\r\n?|\n)|/*.?*/', '\n', text, flags=re.S)
return text

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions