diff --git a/billiard/compat.py b/billiard/compat.py index b20677c..59de905 100644 --- a/billiard/compat.py +++ b/billiard/compat.py @@ -102,7 +102,7 @@ def get_fdmax(default=None): """ try: return os.sysconf('SC_OPEN_MAX') - except: + except Exception: pass if resource is None: # Windows return default diff --git a/billiard/connection.py b/billiard/connection.py index ecfd9ee..baf2167 100644 --- a/billiard/connection.py +++ b/billiard/connection.py @@ -315,7 +315,7 @@ def _send_bytes(self, buf): [ov.event], False, INFINITE) assert waitres == WAIT_OBJECT_0 - except: + except Exception: ov.cancel() raise finally: @@ -735,7 +735,7 @@ def accept(self): try: _winapi.WaitForMultipleObjects( [ov.event], False, INFINITE) - except: + except Exception: ov.cancel() _winapi.CloseHandle(handle) raise diff --git a/billiard/forkserver.py b/billiard/forkserver.py index 9e6a9c9..f1cec91 100644 --- a/billiard/forkserver.py +++ b/billiard/forkserver.py @@ -75,7 +75,7 @@ def connect_to_new_process(self, fds): try: reduction.sendfds(client, allfds) return parent_r, parent_w - except: + except Exception: os.close(parent_r) os.close(parent_w) raise @@ -124,7 +124,7 @@ def ensure_running(self): args = [exe] + util._args_from_interpreter_flags() args += ['-c', cmd] spawnv_passfds(exe, args, fds_to_pass) - except: + except Exception: os.close(alive_w) raise finally: diff --git a/billiard/managers.py b/billiard/managers.py index 6a496c6..c208949 100644 --- a/billiard/managers.py +++ b/billiard/managers.py @@ -348,7 +348,7 @@ def shutdown(self, c): try: util.debug('Manager received shutdown message') c.send(('#RETURN', None)) - except: + except Exception: import traceback traceback.print_exc() finally: diff --git a/billiard/popen_spawn_win32.py b/billiard/popen_spawn_win32.py index 2325492..ba27524 100644 --- a/billiard/popen_spawn_win32.py +++ b/billiard/popen_spawn_win32.py @@ -64,7 +64,7 @@ def __init__(self, process_obj): spawn.get_executable(), cmd, None, None, False, 0, None, None, None) close_thread_handle(ht) - except: + except Exception: _winapi.CloseHandle(rhandle) raise diff --git a/billiard/process.py b/billiard/process.py index 5082343..5356cc4 100644 --- a/billiard/process.py +++ b/billiard/process.py @@ -333,7 +333,7 @@ def _bootstrap(self): sys.stderr.write(str(exc.args[0]) + '\n') _maybe_flush(sys.stderr) exitcode = 0 if isinstance(exc.args[0], str) else 1 - except: + except Exception: exitcode = 1 if not util.error('Process %s', self.name, exc_info=True): import traceback diff --git a/billiard/resource_sharer.py b/billiard/resource_sharer.py index 243f5e3..722720d 100644 --- a/billiard/resource_sharer.py +++ b/billiard/resource_sharer.py @@ -153,7 +153,7 @@ def _serve(self): send(conn, destination_pid) finally: close() - except: + except Exception: if not util.is_exiting(): sys.excepthook(*sys.exc_info()) diff --git a/billiard/semaphore_tracker.py b/billiard/semaphore_tracker.py index 8ba0df4..23246ad 100644 --- a/billiard/semaphore_tracker.py +++ b/billiard/semaphore_tracker.py @@ -59,7 +59,7 @@ def ensure_running(self): args = [exe] + util._args_from_interpreter_flags() args += ['-c', cmd % r] spawnv_passfds(exe, args, fds_to_pass) - except: + except Exception: os.close(w) raise else: @@ -121,7 +121,7 @@ def main(fd): except Exception: try: sys.excepthook(*sys.exc_info()) - except: + except Exception: pass finally: # all processes have terminated; cleanup any remaining semaphores