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:
parent
59c8e5c3d1
commit
8fdbd94d71
@ -121,6 +121,7 @@ Fixed
|
|||||||
(U+2028/U+2029/BOM).
|
(U+2028/U+2029/BOM).
|
||||||
- Movements in caret mode now should work correctly on OS X and Windows.
|
- Movements in caret mode now should work correctly on OS X and Windows.
|
||||||
- Fixed upgrade from earlier config versions.
|
- Fixed upgrade from earlier config versions.
|
||||||
|
- Fixed crash when killing a running userscript.
|
||||||
|
|
||||||
v0.4.1
|
v0.4.1
|
||||||
------
|
------
|
||||||
|
@ -113,7 +113,6 @@ class _BaseUserscriptRunner(QObject):
|
|||||||
self._proc = guiprocess.GUIProcess(self._win_id, 'userscript',
|
self._proc = guiprocess.GUIProcess(self._win_id, 'userscript',
|
||||||
additional_env=self._env,
|
additional_env=self._env,
|
||||||
verbose=verbose, parent=self)
|
verbose=verbose, parent=self)
|
||||||
self._proc.error.connect(self.on_proc_error)
|
|
||||||
self._proc.finished.connect(self.on_proc_finished)
|
self._proc.finished.connect(self.on_proc_finished)
|
||||||
self._proc.start(cmd, args)
|
self._proc.start(cmd, args)
|
||||||
|
|
||||||
@ -158,10 +157,6 @@ class _BaseUserscriptRunner(QObject):
|
|||||||
"""
|
"""
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def on_proc_error(self, error):
|
|
||||||
"""Called when the process encountered an error."""
|
|
||||||
raise NotImplementedError
|
|
||||||
|
|
||||||
|
|
||||||
class _POSIXUserscriptRunner(_BaseUserscriptRunner):
|
class _POSIXUserscriptRunner(_BaseUserscriptRunner):
|
||||||
|
|
||||||
@ -202,10 +197,6 @@ class _POSIXUserscriptRunner(_BaseUserscriptRunner):
|
|||||||
"""Interrupt the reader when the process finished."""
|
"""Interrupt the reader when the process finished."""
|
||||||
self.finish()
|
self.finish()
|
||||||
|
|
||||||
def on_proc_error(self, error):
|
|
||||||
"""Interrupt the reader when the process had an error."""
|
|
||||||
self.finish()
|
|
||||||
|
|
||||||
def finish(self):
|
def finish(self):
|
||||||
"""Quit the thread and clean up when the reader finished."""
|
"""Quit the thread and clean up when the reader finished."""
|
||||||
log.procs.debug("Cleaning up")
|
log.procs.debug("Cleaning up")
|
||||||
@ -256,11 +247,6 @@ class _WindowsUserscriptRunner(_BaseUserscriptRunner):
|
|||||||
self._cleanup()
|
self._cleanup()
|
||||||
self.finished.emit()
|
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):
|
def run(self, cmd, *args, env=None, verbose=False):
|
||||||
try:
|
try:
|
||||||
self._oshandle, self._filepath = tempfile.mkstemp(text=True)
|
self._oshandle, self._filepath = tempfile.mkstemp(text=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user