From b9c044b8c9a92e88a4870e5f53fc0f56e9e5d72f Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 31 Mar 2014 13:50:23 -0500 Subject: [PATCH] Making the exception caught during os.dup of stdin explicit Related to f23bb34 --- lib/ansible/runner/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 8227083c55..f6b607e1d2 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -511,7 +511,7 @@ class Runner(object): if not new_stdin and fileno is not None: try: self._new_stdin = os.fdopen(os.dup(fileno)) - except: + except OSError, e: # couldn't dupe stdin, most likely because it's # not a valid file descriptor, so we just rely on # using the one that was passed in @@ -1103,7 +1103,7 @@ class Runner(object): if fileno is not None: try: new_stdin = os.fdopen(os.dup(fileno)) - except: + except OSError, e: # couldn't dupe stdin, most likely because it's # not a valid file descriptor, so we just rely on # using the one that was passed in