IPython/core/history.py: Handle RuntimeError on Thread.start - #14318
Conversation
|
|
||
| @only_when_enabled | ||
| def run(self): | ||
| atexit.register(self.stop) |
There was a problem hiding this comment.
Hum, interesting. I haven't looked at this code in while, and not too familiar with threading.
Would it also be more correct to atexit.unregister(self.stop) in def stop(self) itself ?
| "Failed to start history saving thread. History will not be saved.", | ||
| exc_info=True, | ||
| ) | ||
| self.hist_file = ":memory:" |
There was a problem hiding this comment.
+1. Should we also have a condition that check if we are im emscripten to be explicit ?
There was a problem hiding this comment.
At the moment, I have to say that I don't have a clear picture of what codepaths in IPython have a chance to be useful within emscripten (cf. pyodide/pyodide#4452 (comment)). So I'd be reluctant to propose specific checks for the emscripten platform in places that do not already have platform-specific code (in contrast to #14316, thanks for merging that!).
…g HistorySavingThread.start
…ter on termination
|
Thanks ! |
On the emscripten (Pyodide),
HistorySavingThread.startraisesRuntimeError.We handle this exception here.
It also reveals a misplaced
atexitcall, which we also fix here.