Skip to content

Commit

Permalink
Change exit() to sys.exit()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tofu-rocketry committed May 21, 2024
1 parent e3f5c81 commit aff1392
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 warning on line 69 in bin/receiver.py

View check run for this annotation

Codecov / codecov/patch

bin/receiver.py#L69

Added line #L69 was not covered by tests

# Check for pidfile
pidfile = cp.get('daemon', 'pidfile')
Expand Down
3 changes: 2 additions & 1 deletion bin/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import logging
from optparse import OptionParser
import os
import sys

Check warning on line 27 in bin/sender.py

View check run for this annotation

Codecov / codecov/patch

bin/sender.py#L27

Added line #L27 was not covered by tests

try:
import ConfigParser
Expand Down Expand Up @@ -57,7 +58,7 @@ def main():
cp.read(options.config)
else:
print("Config file not found at", options.config)
exit(1)
sys.exit(1)

Check warning on line 61 in bin/sender.py

View check run for this annotation

Codecov / codecov/patch

bin/sender.py#L61

Added line #L61 was not covered by tests

ssm.agents.logging_helper(cp)

Expand Down

0 comments on commit aff1392

Please sign in to comment.