Commits

Benoît Allard  committed 7c16c14

mscgen: Add a workaround for the missing shebang of epstopdf

  • Participants
  • Parent commits 769a137

Comments (0)

Files changed (1)

File mscgen/sphinxcontrib/mscgen.py

 
 def run_cmd(builder, cmd, cmd_name, cfg_name, stdin=''):
     try:
-        p = Popen(cmd, stdout=PIPE, stdin=PIPE, stderr=PIPE)
+        try:
+            p = Popen(cmd, stdout=PIPE, stdin=PIPE, stderr=PIPE)
+        except OSError, err:
+            # workaround for missing shebang of epstopdf script
+            if err.errno != getattr(errno, 'ENOEXEC', 0):
+                raise
+            p = Popen(cmd, shell=True, stdout=PIPE, stdin=PIPE, stderr=PIPE)
     except OSError, err:
         if err.errno != 2:   # No such file or directory
             raise