소스 검색

tools/kemi: escape docstrings when required (#3824)

some of the documentation contains \ which need escaping
tsearle 1 년 전
부모
커밋
999d0c6540
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      misc/tools/kemi/python_mock/kemi_mock.py

+ 1 - 1
misc/tools/kemi/python_mock/kemi_mock.py

@@ -129,7 +129,7 @@ def generate_function_doc(module_name, func, prefix):
                 print(prefix + "\t\"\"\"")
                 documentation_lines = documentation[module_name]["functions"][function_prefix].split("\n")
                 for line in documentation_lines:
-                    print(prefix + "\t" + line)
+                    print(prefix + "\t" + line.replace("\\", "\\\\\\\\"))
                 print(prefix + "\t\"\"\"")
                 break