summaryrefslogtreecommitdiff
path: root/python3
diff options
context:
space:
mode:
authorBlackEagle <ike.devolder@gmail.com>2019-07-05 19:57:06 +0200
committerBlackEagle <ike.devolder@gmail.com>2019-07-05 19:57:06 +0200
commitdaa3338c9ee8a948299673f025f06cde0f934ce0 (patch)
tree61a9f9429169feb5fed8dd3695aea4eefb68feda /python3
parentc7ae718e2d8e8c2d5af7e0ae4b8931ceb40a1d9f (diff)
downloadvdebug-daa3338c9ee8a948299673f025f06cde0f934ce0.zip
first check connection before detaching
When there is no connection and you were detaching you just got a stacktrace. So first check if there is an actual connection to detach from. Signed-off-by: BlackEagle <ike.devolder@gmail.com>
Diffstat (limited to 'python3')
-rw-r--r--python3/vdebug/session.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/python3/vdebug/session.py b/python3/vdebug/session.py
index 2e0f5d0..893b8d6 100644
--- a/python3/vdebug/session.py
+++ b/python3/vdebug/session.py
@@ -222,8 +222,10 @@ class Session:
def detach(self):
"""Detach the debugger engine, and allow it to continue execution.
"""
- self.__ui.say("Detaching the debugger")
- self.__api.detach()
+ if self.is_connected():
+ self.__ui.say("Detaching the debugger")
+ self.__api.detach()
+
self.close_connection(False)
def __set_features(self):