erp5 jupyter kernel: print capturing using AST processor to modify print calls
Before, we we're redirecting `sys.stdout` and this doesn't play nice with the distribute architecture of ERP5 and our Jupyter kernel needs to be adjusted for this. So, we're now using an AST processor to fix print calls. It will modify the print and make it write to a different file-like object. All the writes are collected after code execution and sent to Jupyter. It's still necesasry though to fix print inside other libraries. But for this deeper investigation is necessary because we cannot replace print as a statement inside `exec` contetx, it needs to be used as a function. Code can be compiled to run with `print` as a function, but then external libraries calls will be broken.
Showing
Please register or sign in to comment