Skip to content

Commit bc00092

Browse files
committed
backend_ps: Print strings explicitely when printing error report
1 parent 1bab3c7 commit bc00092

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/matplotlib/backends/backend_ps.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -1471,9 +1471,10 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble,
14711471
stdout=fout, stderr=subprocess.STDOUT)
14721472
except subprocess.CalledProcessError as exc:
14731473
with io.open(outfile, 'rb') as fh:
1474-
raise RuntimeError('LaTeX was not able to process your file: '
1475-
'Here is the full report generated by LaTeX'
1476-
'\n\n%s'% (fh.read()))
1474+
raise RuntimeError('LaTeX was not able to process the following '
1475+
'file:\n%s\n'
1476+
'Here is the full report generated by LaTeX:'
1477+
'%s\n\n' % (latexfile, fh.read()))
14771478
else:
14781479
with io.open(outfile, 'rb') as fh:
14791480
verbose.report(fh.read(), 'debug')
@@ -1485,12 +1486,12 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, custom_preamble,
14851486
try:
14861487
with open(outfile, "w") as fout:
14871488
subprocess.check_call(command, cwd=tmpdir,
1488-
stdout=fout, stderr=subprocess.STDOUT)
1489+
stdout=fout, stderr=subprocess.STDOUT)
14891490
except subprocess.CalledProcessError as exc:
14901491
with io.open(outfile, 'rb') as fh:
14911492
raise RuntimeError('dvips was not able to process the following '
14921493
'file:\n%s\nHere is the full report generated '
1493-
'by dvips: \n\n'% dvifile + fh.read())
1494+
'by dvips: %s \n\n' % (dvifile, fh.read()))
14941495
else:
14951496
with io.open(outfile, 'rb') as fh:
14961497
verbose.report(fh.read(), 'debug')

0 commit comments

Comments
 (0)