Преглед изворни кода

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