diff --git a/pythonx/vdebug/event.py b/pythonx/vdebug/event.py index 21f45ecd..67b90544 100644 --- a/pythonx/vdebug/event.py +++ b/pythonx/vdebug/event.py @@ -262,12 +262,12 @@ def run(self, status): if str(status) == "interactive": self.ui.error("Debugger engine says it is in interactive mode," "which is not supported: closing connection") - #self.__breakpoints.unlink_api() + log.Log("closing connection because of interactive mode") self.session.close_connection() elif str(status) in ("stopping", "stopped"): self.ui.set_status("stopped") self.ui.say("Debugging session has ended") - #self.__breakpoints.unlink_api() + log.Log("closing connection because status is stopped") self.session.close_connection(False) if opts.Options.get('continuous_mode', int) != 0: self.dispatch("listen") diff --git a/pythonx/vdebug/util.py b/pythonx/vdebug/util.py index 2476889d..7dac94eb 100644 --- a/pythonx/vdebug/util.py +++ b/pythonx/vdebug/util.py @@ -6,6 +6,7 @@ import sys import time import traceback +import codecs try: import urllib.parse as urllib except ImportError: @@ -49,7 +50,9 @@ def handle_interrupt(self): def handle_socket_end(self): """Handle a socket closing, which is pretty normal. """ - self._session_handler.ui().say("Connection to the debugger has been closed") + self._session_handler.ui().say( + "Connection to the debugger has been closed" + ) self._session_handler.stop() def handle_vim_error(self, e): @@ -84,7 +87,7 @@ def handle(self, e): elif isinstance(e, error.UserInterrupt): try: self.handle_interrupt() - except: + except Exception as e: pass elif isinstance(e, self.readable_errors): self.handle_readable_error(e) @@ -96,12 +99,10 @@ def handle(self, e): print("Keyboard interrupt - debugging session cancelled") try: self._session_handler.stop() - except: + except Exception as e: pass else: self.handle_general_exception() - #elif isinstance(e,vim.error): - # self.handle_vim_error(e) class Keymapper: @@ -137,7 +138,6 @@ def map(self): def reload(self): self.is_mapped = False - self._reload_keys() self.map() def _reload_keys(self): @@ -153,7 +153,8 @@ def _store_old_map(self): keys = {v for k, v in self.keymaps.items() if k not in self.exclude} special = {"", "", "", "