summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/tex/latex/python/python.sty10
1 files changed, 7 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/python/python.sty b/Master/texmf-dist/tex/latex/python/python.sty
index 2d08fdf6cd4..760476ee530 100644
--- a/Master/texmf-dist/tex/latex/python/python.sty
+++ b/Master/texmf-dist/tex/latex/python/python.sty
@@ -25,8 +25,12 @@
%% no more than 15 \newwrites are allowed (and the previous version created a new
%% every time \@writemodule was called.
+%% 0.21 -> 0.22: Fixed bug where spurious spaces were introduced in the output.
+%% Thanks goes to Gernot Salzer <gernot.salzer@tuwien.ac.at> for pointing out
+%% the bug and providing a patch.
+
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
-\ProvidesPackage{python}[2007/06/07 v0.21 Python in LaTeX]
+\ProvidesPackage{python}[2021/08/03 v0.22 Python in LaTeX]
\newwrite\@out
\newwrite\@module
@@ -39,7 +43,7 @@
\def\python{\kernel@ifnextchar [{\@python}{\@python[]}}
\def\@python[#1]{%
-\gdef\@pythoninclude{#1}
+\gdef\@pythoninclude{#1}%
\immediate\openout\@out=\jobname.py
\newlinechar='15
\begingroup \catcode`\^^M=12 %
@@ -50,7 +54,7 @@
\endgroup
\immediate\closeout\@out
\@writemodule
-\immediate\write18{cat \@pythoninclude\space\jobname.py | python > \jobname.py.out 2> \jobname.py.err}
+\immediate\write18{cat \@pythoninclude\space\jobname.py | python > \jobname.py.out 2> \jobname.py.err}%
\immediate\input\jobname.py.out}
%\immediate\write{\begin{verbatim}}
%\immediate\input\jobname.py.err