forked from bartvdbraak/blender
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:
parent
d2639e732b
commit
e9ffd12133
@ -72,7 +72,6 @@ static int find_file_mouse(SpaceFile *sfile, struct ARegion* ar, short x, short
|
||||
{
|
||||
float fx,fy;
|
||||
int active_file = -1;
|
||||
int numfiles = filelist_numfiles(sfile->files);
|
||||
View2D* v2d = &ar->v2d;
|
||||
|
||||
UI_view2d_region_to_view(v2d, x, y, &fx, &fy);
|
||||
|
@ -155,7 +155,7 @@ static void file_free(SpaceLink *sl)
|
||||
/* spacetype; init callback, area size changes, screen set, etc */
|
||||
static void file_init(struct wmWindowManager *wm, ScrArea *sa)
|
||||
{
|
||||
SpaceFile *sfile= (SpaceFile*)sa->spacedata.first;
|
||||
//SpaceFile *sfile= (SpaceFile*)sa->spacedata.first;
|
||||
printf("file_init\n");
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#include "transform.h"
|
||||
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
/* ************************** INPUT FROM MOUSE *************************** */
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user