From: Arnaud Giersch Date: Mon, 24 Jan 2022 14:07:53 +0000 (+0100) Subject: Catch more specific exceptions. X-Git-Tag: v3.30~36 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3c81f0e12c0996283144a5fe61cfb4c748928b0b Catch more specific exceptions. --- 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