1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

Resolve regex library warnings (#8890)

This commit is contained in:
Emmanuel Ferdman
2025-05-26 10:45:47 +03:00
committed by GitHub
parent ca0037d076
commit 5921a9cd68

View File

@@ -416,7 +416,9 @@ class LineComment(Statement):
self.value = value
def __str__(self):
parts = re.sub(r"\\\s*\n", r"<cont>\n", self.value, re.MULTILINE).split("\n")
parts = re.sub(r"\\\s*\n", r"<cont>\n", self.value, flags=re.MULTILINE).split(
"\n"
)
parts = [f"// {x}" for x in parts]
return "\n".join(parts)