workaround for [#21486] Python debuger pdb don't work

setting sys.stdin to None is done so python wont lock blender when it tries to read from the input. - help() from the console does this.
Running blender with -d keeps the stdin so python debugging can work. add info in the help message about this.

eventually it might be best to replace sys.stdin with our own object which interacts with the console but this is not trivial.
This commit is contained in:
Campbell Barton 2010-03-08 12:29:58 +00:00
parent 1138214a8c
commit 9ce5be3706
2 changed files with 6 additions and 1 deletions

@ -46,7 +46,9 @@ def _main():
# 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 :|
_sys.stdin = None
if not app.debug:
_sys.stdin = None
# if "-d" in sys.argv: # Enable this to measure startup speed
if 0:

@ -230,6 +230,9 @@ static int print_help(int argc, char **argv, void *data)
printf ("\nMisc options:\n");
printf (" -d\t\tTurn debugging on\n");
printf (" \t\t * prints every operator call and their arguments\n");
printf (" \t\t * disables mouse grab (to interact with a debugger in some cases)\n");
printf (" \t\t * keeps python sys.stdin rather then setting it to None\n");
printf (" -nojoystick\tDisable joystick support\n");
printf (" -noglsl\tDisable GLSL shading\n");
printf (" -noaudio\tForce sound system to None\n");