From a5c69b2d94ab886568165e90740beb50d40faa54 Mon Sep 17 00:00:00 2001 From: snipe_blaze <72265661+notsniped@users.noreply.github.com> Date: Tue, 27 Sep 2022 15:11:51 +0530 Subject: [PATCH] Add cleanup command to clean up environment of all variables --- app/main.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index 0382cc3..12cdb36 100644 --- a/app/main.py +++ b/app/main.py @@ -44,9 +44,14 @@ def listen_for_command(errorcode): # else: errcode = None return rescode -#def cleanup(reason: str): -# """Cleans up the environment""" -# print(f"Environment clean-up initialized: {reason}") +def cleanup(): + """Cleans up the environment of all variables""" + del errcode + del wdir + del pid + del host + del user + del colors # Initialization @@ -55,6 +60,6 @@ def listen_for_command(errorcode): try: errcode = listen_for_command(errcode) except KeyboardInterrupt: print("Keyboard Interrupt initialized. Cleaning up...") -# cleanup("Manually initialized exit [KeyboardInterrupt]") + cleanup() exit(130)