Merge pull request #295 from strottie/master

Minor fixes
This commit is contained in:
Matt Rose 2020-11-19 08:37:13 -05:00 committed by GitHub
commit bf89313138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -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()

View File

@ -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)