@@ -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:" + repr(err[0]) + "\n")
+
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:" + repr(err[0]) + "\n")
+
return bool(exit_code == 0)