Adjust entrez.py to print the name of failing external commands.
authorW. Trevor King <wking@drexel.edu>
Wed, 20 Jul 2011 16:52:54 +0000 (12:52 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 20 Jul 2011 16:52:57 +0000 (12:52 -0400)
This provides a useful hint if someone forgot to install one of the
dependencies.

posts/entrez/entrez.py

index 11356aa188c43c051b8b88fde7dcfb1b258d866e..b02a32c2186c4ff34b289ab4d6f3457341f53eb3 100755 (executable)
@@ -150,10 +150,13 @@ class Pipe (object):
             kwargs = {}
             if _POSIX:
                 kwargs['close_fds'] = True
-            self._procs.append(_subprocess.Popen(
-                    cmd, stdin=stdin, stdout=_subprocess.PIPE,
-                    stderr=_subprocess.PIPE, **kwargs))
-
+            try:
+                self._procs.append(_subprocess.Popen(
+                        cmd, stdin=stdin, stdout=_subprocess.PIPE,
+                        stderr=_subprocess.PIPE, **kwargs))
+            except OSError:
+                LOG.error(cmd)
+                raise
         self.stdout,self.stderrs = self._communicate(input=stdin_str)
 
         # collect process statuses