Skip to content

Commit 1bf2c63

Browse files
committed
[ci][docs] Fix escaping of regexes in converttonotebook.
Strings such as "\s" are not correct, any more.
1 parent 1344400 commit 1bf2c63

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

documentation/doxygen/converttonotebook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def findBracedBlock(text, startpos, openingBraceChar):
423423

424424

425425
def findStuffBeforeFunc(text, searchStart, searchEnd):
426-
beforeFunctionRe = re.compile("(;|}|//[^\n]*)\s*$", flags = re.MULTILINE)
426+
beforeFunctionRe = re.compile("(;|}|//[^\n]*)\\s*$", flags = re.MULTILINE)
427427
try:
428428
# Find the last '}' or comment line etc before function definition:
429429
lastMatchBeforeFunc = [thisMatch for thisMatch in beforeFunctionRe.finditer(text, searchStart, searchEnd)][-1]
@@ -622,7 +622,7 @@ def changeString(matchObject):
622622
matchString = matchString.replace("THISISASPACE" , " ")
623623
return matchString
624624

625-
newcode = re.sub("#\s\s?\w\s[\w-]\s\w.*", changeString , code)
625+
newcode = re.sub(r"#\s\s?\w\s[\w-]\s\w.*", changeString , code)
626626
return newcode
627627

628628
def declareNamespace(code):

0 commit comments

Comments
 (0)