Skip to content

Commit d81ea42

Browse files
committed
backend_ps: Print strings explicitely when printing error report
1 parent 1140314 commit d81ea42

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/matplotlib/backends/backend_ps.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,9 +1470,10 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble,
14701470
stdout=fout, stderr=subprocess.STDOUT)
14711471
except subprocess.CalledProcessError as exc:
14721472
with io.open(outfile, 'rb') as fh:
1473-
raise RuntimeError('LaTeX was not able to process your file: '
1474-
'Here is the full report generated by LaTeX'
1475-
'\n\n%s'% (fh.read()))
1473+
raise RuntimeError('LaTeX was not able to process the following '
1474+
'file:\n%s\n'
1475+
'Here is the full report generated by LaTeX:'
1476+
'%s\n\n' % (latexfile, fh.read()))
14761477
else:
14771478
with io.open(outfile, 'rb') as fh:
14781479
verbose.report(fh.read(), 'debug')
@@ -1484,12 +1485,12 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble,
14841485
try:
14851486
with open(outfile, "w") as fout:
14861487
subprocess.check_call(command, cwd=tmpdir,
1487-
stdout=fout, stderr=subprocess.STDOUT)
1488+
stdout=fout, stderr=subprocess.STDOUT)
14881489
except subprocess.CalledProcessError as exc:
14891490
with io.open(outfile, 'rb') as fh:
14901491
raise RuntimeError('dvips was not able to process the following '
14911492
'file:\n%s\nHere is the full report generated '
1492-
'by dvips: \n\n'% dvifile + fh.read())
1493+
'by dvips: %s \n\n' % (dvifile, fh.read()))
14931494
else:
14941495
with io.open(outfile, 'rb') as fh:
14951496
verbose.report(fh.read(), 'debug')

0 commit comments

Comments
 (0)