From 3c81f0e12c0996283144a5fe61cfb4c748928b0b Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 24 Jan 2022 15:07:53 +0100 Subject: [PATCH 1/1] Catch more specific exceptions. --- tools/appveyor-irc-notify.py | 2 +- tools/tesh/tesh.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/appveyor-irc-notify.py b/tools/appveyor-irc-notify.py index 463104f386..fee4c019e1 100644 --- a/tools/appveyor-irc-notify.py +++ b/tools/appveyor-irc-notify.py @@ -174,7 +174,7 @@ if __name__ == '__main__': # leave the channel irc_sock.send('PART #{}\r\n'.format(channel).encode('utf_8')) sys.exit() - except BaseException: + except Exception: e = sys.exc_info()[0] print(e) sys.exit() diff --git a/tools/tesh/tesh.py b/tools/tesh/tesh.py index 8b9ae298c6..69a0617d43 100755 --- a/tools/tesh/tesh.py +++ b/tools/tesh/tesh.py @@ -122,7 +122,7 @@ def kill_process_group(pid): try: pgid = os.getpgid(pid) - except: + except OSError: # os.getpgid failed. Ok, don't cleanup. return -- 2.20.1