diff --git a/problemtools/ProblemPlasTeX/__init__.py b/problemtools/ProblemPlasTeX/__init__.py index b136ab7a..a7da5e09 100644 --- a/problemtools/ProblemPlasTeX/__init__.py +++ b/problemtools/ProblemPlasTeX/__init__.py @@ -59,9 +59,9 @@ def getImage(self, node): newext = self.imageConversion[oldext][0] path = os.path.splitext(path)[0] + newext cmd = self.imageConversion[oldext][1] + [path, name] - status = subprocess.call(cmd) - if status: - log.warning('Failed to convert %s image "%s to %s', oldext, name, newext) + result = subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + if result.returncode: + log.error(f'Failed to convert {oldext} image {name} to {newext}.\n{result.stderr.decode(errors="replace")}') else: # Just copy it path = os.path.splitext(path)[0] + oldext