bugfix [#19392] Typing help() in the console window freezes Blender
for now set the sys.stdin to None, this gives an error on input() or help() but better then locking up blender. Would be nice to support for the blender console to be used as a stdin but this isnt so simple. also quiet some warnings.
This commit is contained in:
@@ -292,6 +292,11 @@ void BPY_start_python( int argc, char **argv )
|
||||
PyObject *d = PyEval_GetBuiltins( );
|
||||
PyDict_SetItemString(d, "reload", item=PyCFunction_New(bpy_reload_meth, NULL)); Py_DECREF(item);
|
||||
PyDict_SetItemString(d, "__import__", item=PyCFunction_New(bpy_import_meth, NULL)); Py_DECREF(item);
|
||||
|
||||
/* a bit nasty but this prevents help() and input() from locking blender
|
||||
* Ideally we could have some way for the console to replace sys.stdin but
|
||||
* python would lock blender while waiting for a return value, not easy :| */
|
||||
PySys_SetObject("stdin", Py_None);
|
||||
}
|
||||
|
||||
pyrna_alloc_types();
|
||||
|
||||
Reference in New Issue
Block a user