userscripts: Remove on_proc_error.

When there was an error, the finished signal will be emitted too anyways, so if
we call cleanup here, we'll call it twice which means we'll get an exception.

Supersedes #1175.
This commit is contained in:
Florian Bruhin 2015-12-21 08:35:09 +01:00
parent 59c8e5c3d1
commit 8fdbd94d71
2 changed files with 1 additions and 14 deletions

View File

@ -121,6 +121,7 @@ Fixed
(U+2028/U+2029/BOM).
- Movements in caret mode now should work correctly on OS X and Windows.
- Fixed upgrade from earlier config versions.
- Fixed crash when killing a running userscript.
v0.4.1
------

View File

@ -113,7 +113,6 @@ class _BaseUserscriptRunner(QObject):
self._proc = guiprocess.GUIProcess(self._win_id, 'userscript',
additional_env=self._env,
verbose=verbose, parent=self)
self._proc.error.connect(self.on_proc_error)
self._proc.finished.connect(self.on_proc_finished)
self._proc.start(cmd, args)
@ -158,10 +157,6 @@ class _BaseUserscriptRunner(QObject):
"""
raise NotImplementedError
def on_proc_error(self, error):
"""Called when the process encountered an error."""
raise NotImplementedError
class _POSIXUserscriptRunner(_BaseUserscriptRunner):
@ -202,10 +197,6 @@ class _POSIXUserscriptRunner(_BaseUserscriptRunner):
"""Interrupt the reader when the process finished."""
self.finish()
def on_proc_error(self, error):
"""Interrupt the reader when the process had an error."""
self.finish()
def finish(self):
"""Quit the thread and clean up when the reader finished."""
log.procs.debug("Cleaning up")
@ -256,11 +247,6 @@ class _WindowsUserscriptRunner(_BaseUserscriptRunner):
self._cleanup()
self.finished.emit()
def on_proc_error(self, error):
"""Clean up when the process had an error."""
self._cleanup()
self.finished.emit()
def run(self, cmd, *args, env=None, verbose=False):
try:
self._oshandle, self._filepath = tempfile.mkstemp(text=True)