From 165e6200436ad14c87defc14fdb48ee84721e1ea Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Thu, 4 Nov 2021 17:14:58 +0100 Subject: [PATCH] Improved shutdown handling on interrupt. Updated gitignore. --- .gitignore | 1 + RNS/Interfaces/LocalInterface.py | 6 ++++-- RNS/__init__.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 90f693d..a6cb8df 100755 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ testutils TODO Examples/RNS +RNS/Utilities/RNS build dist docs/build diff --git a/RNS/Interfaces/LocalInterface.py b/RNS/Interfaces/LocalInterface.py index d886366..3508fcc 100644 --- a/RNS/Interfaces/LocalInterface.py +++ b/RNS/Interfaces/LocalInterface.py @@ -173,8 +173,10 @@ class LocalClientInterface(Interface): # to now that all connectivity has been cut # while service is recovering. Better for # now to take down entire stack. - RNS.log("Lost connection to local shared RNS instance. Exiting now.", RNS.LOG_CRITICAL) - RNS.panic() + if nowarning == False: + RNS.log("Lost connection to local shared RNS instance. Exiting now.", RNS.LOG_CRITICAL) + + RNS.exit() def __str__(self): diff --git a/RNS/__init__.py b/RNS/__init__.py index f08e340..e54ef3a 100755 --- a/RNS/__init__.py +++ b/RNS/__init__.py @@ -120,4 +120,5 @@ def panic(): os._exit(255) def exit(): + print("") sys.exit(0) \ No newline at end of file