From 48dcc0f532ed158815866ec2d7b3666d17704a46 Mon Sep 17 00:00:00 2001 From: Kotesh Kumar Yelamati Date: Sun, 12 Jul 2026 10:58:40 -0400 Subject: [PATCH] Fix bare except in ptyprocess.py: use except Exception --- ptyprocess/ptyprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ptyprocess/ptyprocess.py b/ptyprocess/ptyprocess.py index daf20b1..0b08327 100644 --- a/ptyprocess/ptyprocess.py +++ b/ptyprocess/ptyprocess.py @@ -336,7 +336,7 @@ def spawn( exception = exctype(errmsg.decode('utf-8', 'replace')) if exctype is OSError: exception.errno = int(errno_s) - except: + except Exception: raise Exception('Subprocess failed, got bad error data: %r' % exec_err_data) else: @@ -388,7 +388,7 @@ def __del__(self): try: self.close() # which exception, shouldn't we catch explicitly .. ? - except: + except Exception: pass