From aff1392de586c9f5589e9eef38416975a582d8f9 Mon Sep 17 00:00:00 2001 From: Adrian Coveney Date: Tue, 21 May 2024 10:51:11 +0100 Subject: [PATCH] Change exit() to sys.exit() The "exit()" function is from site.py which may not be present depending on command line options. "sys.exit" on the other hand, will be there as it is imported. --- bin/receiver.py | 2 +- bin/sender.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/receiver.py b/bin/receiver.py index dac81f3b..82674495 100644 --- a/bin/receiver.py +++ b/bin/receiver.py @@ -66,7 +66,7 @@ def main(): cp.read(options.config) else: print("Config file not found at", options.config) - exit(1) + sys.exit(1) # Check for pidfile pidfile = cp.get('daemon', 'pidfile') diff --git a/bin/sender.py b/bin/sender.py index f6d08e98..a058bbc4 100644 --- a/bin/sender.py +++ b/bin/sender.py @@ -24,6 +24,7 @@ import logging from optparse import OptionParser import os +import sys try: import ConfigParser @@ -57,7 +58,7 @@ def main(): cp.read(options.config) else: print("Config file not found at", options.config) - exit(1) + sys.exit(1) ssm.agents.logging_helper(cp)