From 352fdfe2797cd8d08004ff9c59adfab3d0999890 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Trottier Date: Fri, 25 Sep 2020 22:26:27 -0400 Subject: [PATCH 1/2] URLHandler.unload: Fix check for handler_name being set --- terminatorlib/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminatorlib/plugin.py b/terminatorlib/plugin.py index 7e76d9c5..9d2be0e2 100644 --- a/terminatorlib/plugin.py +++ b/terminatorlib/plugin.py @@ -173,7 +173,7 @@ class URLHandler(Plugin): def unload(self): """Handle being removed""" - if not self.match: + if not self.handler_name: err('unload called without self.handler_name being set') return terminator = Terminator() From 912e486b7d098c282993bfe5d977ecda55d258cf Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Trottier Date: Thu, 1 Oct 2020 04:13:47 -0400 Subject: [PATCH 2/2] Terminal.close: Avoid error when self.pid is None --- terminatorlib/terminal.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/terminatorlib/terminal.py b/terminatorlib/terminal.py index 44d95b5c..341285b3 100644 --- a/terminatorlib/terminal.py +++ b/terminatorlib/terminal.py @@ -275,14 +275,15 @@ class Terminal(Gtk.VBox): dbg('close: called') self.cnxids.remove_widget(self.vte) self.emit('close-term') - try: - dbg('close: killing %d' % self.pid) - os.kill(self.pid, signal.SIGHUP) - except Exception as ex: - # We really don't want to care if this failed. Deep OS voodoo is - # not what we should be doing. - dbg('os.kill failed: %s' % ex) - pass + if self.pid is not None: + try: + dbg('close: killing %d' % self.pid) + os.kill(self.pid, signal.SIGHUP) + except Exception as ex: + # We really don't want to care if this failed. Deep OS voodoo is + # not what we should be doing. + dbg('os.kill failed: %s' % ex) + pass if self.vte: self.terminalbox.remove(self.vte)