Skip to content

Commit ff529c3

Browse files
committed
Codegen: use re.escape
1 parent 3694311 commit ff529c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

misc/codegen/generators/qlgen.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@ def _get_stub(cls: schema.Class, base_import: str, generated_import_prefix: str)
318318

319319
_stub_qldoc_header = "// the following QLdoc is generated: if you need to edit it, do it in the schema file\n"
320320

321-
_class_qldoc_re = re.compile(rf"(?P<qldoc>(?:{_stub_qldoc_header})?/\*\*.*?\*/\s*|^\s*)class\s+(?P<class>\w+)",
322-
re.MULTILINE | re.DOTALL)
321+
_class_qldoc_re = re.compile(
322+
rf"(?P<qldoc>(?:{re.escape(_stub_qldoc_header)})?/\*\*.*?\*/\s*|^\s*)class\s+(?P<class>\w+)",
323+
re.MULTILINE | re.DOTALL)
323324

324325

325326
def _patch_class_qldoc(cls: str, qldoc: str, stub_file: pathlib.Path):

0 commit comments

Comments
 (0)