diff --git a/pathos/__main__.py b/pathos/__main__.py index 8aab9a6..9d6830a 100644 --- a/pathos/__main__.py +++ b/pathos/__main__.py @@ -75,7 +75,7 @@ sys.exit(0) try: myinp = sys.argv[1] - except: myinp = None + except IndexError: myinp = None if myinp: rhost = myinp #XXX: should test rhost validity here... (how ?) else: pass # use default @@ -84,7 +84,7 @@ # get server to run from user try: myinp = sys.argv[2] - except: myinp = None + except IndexError: myinp = None if myinp: server = myinp #XXX: should test validity here... (filename) else: pass # use default @@ -101,7 +101,7 @@ # get remote port to run server on from user try: myinp = sys.argv[3] - except: myinp = None + except IndexError: myinp = None if myinp: if tunnel: # tunnel doesn't take more inputs msg = "port '%s' not valid for 'tunnel'" % myinp @@ -117,7 +117,7 @@ # get remote profile (this should go away soon) try: myinp = sys.argv[4] - except: myinp = None + except IndexError: myinp = None if myinp: rprof = myinp #XXX: should test validity here... (filename) profiles = {rhost:rprof} diff --git a/pathos/abstract_launcher.py b/pathos/abstract_launcher.py index 5c95af4..8ad291d 100644 --- a/pathos/abstract_launcher.py +++ b/pathos/abstract_launcher.py @@ -175,7 +175,7 @@ def __pipe(self, f, *args, **kwds): #FIXME: need to think about this... raise TypeError("%s() takes at most %s arguments (%s given)" % (f.__name__(), str(vars), str(arglen))) elif arglen < (vars - defs): raise TypeError("%s() takes at least %s arguments (%s given)" % (f.__name__(), str(vars - defs), str(arglen))) - except: + except Exception: pass return def _serve(self, *args, **kwds): diff --git a/pathos/connection.py b/pathos/connection.py index 97e5c18..26a41f3 100644 --- a/pathos/connection.py +++ b/pathos/connection.py @@ -124,7 +124,7 @@ def _execute(self): p = Popen(self.message, shell=True, stdin=self.stdin, stdout=PIPE, stderr=STDOUT, close_fds=True) - except: + except Exception: raise PipeException('failure to pipe: %s' % self.message) self._pid = p.pid #get fileobject pid self._stdout = p.stdout #save fileobject @@ -132,7 +132,7 @@ def _execute(self): try: p = Popen(self.message, shell=True, stdin=self.stdin, stdout=PIPE) - except: + except Exception: raise PipeException('failure to pipe: %s' % self.message) self._stdout = p.stdout self._pid = 0 #XXX: MMM --> or -1 ? diff --git a/pathos/core.py b/pathos/core.py index 1b09499..ddb076a 100644 --- a/pathos/core.py +++ b/pathos/core.py @@ -262,7 +262,7 @@ def randomport(host=None): launcher.launch() try: rport = int(launcher.response()) - except: + except Exception: from pathos.secure import TunnelException raise TunnelException("failure to pick remote port") # return remote port number