@@ -217,11 +217,13 @@ def dot2format(dot_fname, out_fname):
with open(out_fname, "w") as out:
p = subprocess.Popen(
cmd, stdout = out, stderr = subprocess.PIPE )
- nil, err = p.communicate()
-
- sys.stderr.write(err)
+ err = p.communicate()
exit_code = p.returncode
+
+ if exit_code != 0:
+ sys.stderr.write("Error #%d when calling dot for '%s': %s\n" % (exit_code, dot_fname, repr(err[0])))
+
out.flush()
return bool(exit_code == 0)
@@ -239,11 +241,13 @@ def svg2pdf(svg_fname, pdf_fname):
cmd = [convert_cmd, svg_fname, pdf_fname]
p = subprocess.Popen(
cmd, stdout = out, stderr = subprocess.PIPE )
- nil, err = p.communicate()
-
- sys.stderr.write(err)
+ err = p.communicate()
exit_code = p.returncode
+
+ if exit_code != 0:
+ sys.stderr.write("Error #%d when calling convert for '%s': %s\n" % (exit_code, dot_fname, repr(err[0])))
+
return bool(exit_code == 0)