On quitte un programme avec sys.exit

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-01-26 16:37:48 +01:00
parent 4c241eeb60
commit ca69954315
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#!/usr/bin/env python
from random import choice
import sys
def main():
@ -107,7 +108,7 @@ def stop(exit_code: int = 0):
Stoppe le programme avec le code d'erreur donné.
"""
print("Fin du programme, merci !")
exit(exit_code)
sys.exit(exit_code)
if __name__ == '__main__':