]> git.lyx.org Git - lyx.git/commitdiff
Fix Python SyntaxWarning
authorScott Kostyshak <skostysh@lyx.org>
Thu, 22 Aug 2024 14:51:09 +0000 (10:51 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Thu, 22 Aug 2024 14:54:02 +0000 (10:54 -0400)
Use raw strings to avoid the following syntax warnings that show up
in LastTest.log after running tex2lyx ctests:

  src/tex2lyx/test/runtests.py:135: SyntaxWarning: invalid escape sequence '\o'
    if linex[:-1] == '\origin ' + inputdir + '/':
  src/tex2lyx/test/runtests.py:136: SyntaxWarning: invalid escape sequence '\o'
    lines1[i1] = '\origin ' + outputdir + '/' + "\n"

src/tex2lyx/test/runtests.py

index aae80c14261fccf9eeec151f616c8c22a83db1e1..696123958d7a4235254c3b03b3abffe878d97a31 100755 (executable)
@@ -132,8 +132,8 @@ def main(argv):
                     lines1 = f1.readlines()
                     i1 = 0
                     for linex in lines1:
-                      if linex[:-1] == '\origin ' + inputdir + '/':
-                        lines1[i1] = '\origin ' + outputdir + '/' + "\n"
+                      if linex[:-1] == r'\origin ' + inputdir + '/':
+                        lines1[i1] = r'\origin ' + outputdir + '/' + "\n"
                         break
                       i1 = i1+1
                     lines2 = f2.readlines()