Skip to content

Commit 4a6fcc4

Browse files
committed
better error messages when Weave.jl is not installed or raises errors (gpoore#131)
1 parent 64ab66d commit 4a6fcc4

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

pythontex/pythontex.dtx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
2727
%<package>\ProvidesPackage{pythontex}
2828
%<*package>
29-
[2018/10/03 v0.17dev execute and typeset Python code and other languages]
29+
[2018/10/07 v0.17dev execute and typeset Python code and other languages]
3030
%</package>
3131
%
3232
%<*driver>
@@ -157,6 +157,7 @@
157157
% \begin{changelog}{v0.17}{2018/10/??}
158158
% \begin{itemize}
159159
% \item Updated Julia support for Julia versions 0.6 (\#107), and 0.7 and 1.0 (\#126, \#130).
160+
% \item There are now meaningful error messages for Julia console when Weave.jl is not installed or raises errors (\#131).
160161
% \end{itemize}
161162
% \end{changelog}
162163
%

pythontex/pythontex2.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,12 @@ def run_code(encoding, outputdir, workingdir, code_list, language, commands,
15671567
messages.append('* PythonTeX error')
15681568
messages.append(' Missing output file for ' + key_run.replace('#', ':'))
15691569
errors += 1
1570+
elif family == 'juliacon' and proc.returncode == 1:
1571+
messages.append('* PythonTeX error')
1572+
messages.append(' Running code for Julia console failed')
1573+
with open(err_file_name, encoding='utf8') as f:
1574+
messages.append(f.read())
1575+
errors += 1
15701576
else:
15711577
if family == 'juliacon':
15721578
with open(out_file_name.rsplit('.', 1)[0] + '.tex', 'r', encoding=encoding) as f:

pythontex/pythontex3.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,12 @@ def run_code(encoding, outputdir, workingdir, code_list, language, commands,
15671567
messages.append('* PythonTeX error')
15681568
messages.append(' Missing output file for ' + key_run.replace('#', ':'))
15691569
errors += 1
1570+
elif family == 'juliacon' and proc.returncode == 1:
1571+
messages.append('* PythonTeX error')
1572+
messages.append(' Running code for Julia console failed')
1573+
with open(err_file_name, encoding='utf8') as f:
1574+
messages.append(f.read())
1575+
errors += 1
15701576
else:
15711577
if family == 'juliacon':
15721578
with open(out_file_name.rsplit('.', 1)[0] + '.tex', 'r', encoding=encoding) as f:

0 commit comments

Comments
 (0)