1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 22:22:22 +01:00

fix path on windows escape (#1573)

This commit is contained in:
Guillermo Ruffino
2021-03-01 22:16:36 -03:00
committed by GitHub
parent 422f0ad7a9
commit b17e0c298e

View File

@@ -339,7 +339,8 @@ class DocumentLocation:
@property
def as_line_directive(self):
return f'#line {self.line + 1} "{self.document}"'
document_path = str(self.document).replace('\\', '\\\\')
return f'#line {self.line + 1} "{document_path}"'
class DocumentRange: