Skip to content

Commit 32b7f31

Browse files
committed
Changed exit(x) to sys.exit(x) for better compilation
1 parent 369583b commit 32b7f31

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
thumbs.db
33
venv
44
.vscode
5-
__pycache__
5+
__pycache__
6+
build
7+
dist
8+
github-sshkeys.spec

github-sshkeys.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import json
66
import requests
77
import pycheck
8+
import sys
89

910
GITHUB_API = 'https://api.github.com'
1011

@@ -84,7 +85,7 @@ def main():
8485
# Exit if the user have no keys on his GitHub account
8586
if len(github_keys) == 0:
8687
git.logger.log("You have no SSH keys saved on GitHub. Please save one and try again.")
87-
exit(-1)
88+
sys.exit(-1)
8889

8990
# Ensure that ~/.ssh and ~/.ssh/authorized_keys exist
9091
ensure_authorized_keys_file(git.logger)
@@ -102,10 +103,10 @@ def main():
102103
authorized_keys.write(key["key"])
103104

104105
git.logger.log(str(new_keys_count) + " new keys were added to " + str(SSH_AUTHORIZED_KEYS_FILE.resolve()), True)
105-
# Otherwise exit
106+
# Otherwise sys.exit
106107
else:
107108
git.logger.log("No keys were found.")
108-
exit(0)
109+
sys.exit(0)
109110

110111
if __name__ == '__main__':
111112
main()

pycheck.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
pass
77
else:
88
print("This script only works on python 3.6 and up.")
9-
exit(-1)
9+
sys.exit(-1)

0 commit comments

Comments
 (0)