[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27323] trunk/blender: workaround for [ #21486] Python debuger pdb don't work

Campbell Barton ideasman42 at gmail.com
Mon Mar 8 13:29:58 CET 2010


Revision: 27323
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27323
Author:   campbellbarton
Date:     2010-03-08 13:29:58 +0100 (Mon, 08 Mar 2010)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy/__init__.py
    trunk/blender/source/creator/creator.c

Modified: trunk/blender/release/scripts/modules/bpy/__init__.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/__init__.py	2010-03-08 11:47:43 UTC (rev 27322)
+++ trunk/blender/release/scripts/modules/bpy/__init__.py	2010-03-08 12:29:58 UTC (rev 27323)
@@ -46,7 +46,9 @@
     # 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:

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c	2010-03-08 11:47:43 UTC (rev 27322)
+++ trunk/blender/source/creator/creator.c	2010-03-08 12:29:58 UTC (rev 27323)
@@ -230,6 +230,9 @@
 
 	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");





More information about the Bf-blender-cvs mailing list