diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-21 16:23:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-21 16:23:56 +0400 |
commit | e9ffd121337d0d5d50bc8771a36117dc3696b315 (patch) | |
tree | 15800d0742ecc3ffb74ebc0ddd3d80c13a62b37c /source/blender/python/intern/bpy_interface.c | |
parent | d2639e732b345ce32ec26c42d0e3ca6df4eb761a (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.c | 5 |
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(); |