From 85753dfe2f01898542e6f4f000735b41ffd05d21 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 20 Jul 2011 12:52:54 -0400 Subject: [PATCH] Adjust entrez.py to print the name of failing external commands. This provides a useful hint if someone forgot to install one of the dependencies. --- posts/entrez/entrez.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/posts/entrez/entrez.py b/posts/entrez/entrez.py index 11356aa..b02a32c 100755 --- a/posts/entrez/entrez.py +++ b/posts/entrez/entrez.py @@ -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 -- 2.26.2