Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-09-21 16:23:56 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-21 16:23:56 +0400
commite9ffd121337d0d5d50bc8771a36117dc3696b315 (patch)
tree15800d0742ecc3ffb74ebc0ddd3d80c13a62b37c /source/blender/python/intern/bpy_interface.c
parentd2639e732b345ce32ec26c42d0e3ca6df4eb761a (diff)
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.
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r--source/blender/python/intern/bpy_interface.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index fd8cfc47f55..3e28bc7968f 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -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();