summaryrefslogtreecommitdiff
path: root/docutils/utils/math
diff options
context:
space:
mode:
authormilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2022-01-26 19:05:25 +0000
committermilde <milde@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>2022-01-26 19:05:25 +0000
commite2f25e57799dd9cd62a2b14b385a7f150ff885f9 (patch)
tree53621512e07f301714514754ff7d7352eb8b2687 /docutils/utils/math
parent7d5fe18783f0ee9151bf54bd25bba6fcfabead31 (diff)
downloaddocutils-e2f25e57799dd9cd62a2b14b385a7f150ff885f9.tar.gz
Skip assigning to a variable when immediately returning
Patch by Adam Turner git-svn-id: https://svn.code.sf.net/p/docutils/code/trunk/docutils@8980 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/utils/math')
-rwxr-xr-xdocutils/utils/math/math2html.py3
-rw-r--r--docutils/utils/math/tex2mathml_extern.py3
2 files changed, 2 insertions, 4 deletions
diff --git a/docutils/utils/math/math2html.py b/docutils/utils/math/math2html.py
index 1e5b667c4..86333498b 100755
--- a/docutils/utils/math/math2html.py
+++ b/docutils/utils/math/math2html.py
@@ -1479,8 +1479,7 @@ class StringContainer(Container):
return replaced
def changeline(self, line):
- line = self.escape(line, EscapeConfig.chars)
- return line
+ return self.escape(line, EscapeConfig.chars)
def extracttext(self):
"Return all text."
diff --git a/docutils/utils/math/tex2mathml_extern.py b/docutils/utils/math/tex2mathml_extern.py
index b68ecc191..83855fa18 100644
--- a/docutils/utils/math/tex2mathml_extern.py
+++ b/docutils/utils/math/tex2mathml_extern.py
@@ -96,8 +96,7 @@ def ttm(math_code, reporter=None):
if reporter and err.find('**** Error') >= 0 or not result:
reporter.error(err)
start, end = result.find('<math'), result.find('</math>')+7
- result = result[start:end]
- return result
+ return result[start:end]
def blahtexml(math_code, inline=True, reporter=None):
"""Convert LaTeX math code to MathML with blahtexml_