[Bf-python] Some python issues

Stephen Swaney sswaney at centurytel.net
Wed Apr 12 17:20:20 CEST 2006


On Wed, Apr 12, 2006 at 04:56:38PM +0200, german at sistrans.com wrote:
> Using blender as development base for piece of software (degree project) i've found this 3 problems:
>     
> a) When importing a module (a blender text) that has import errors instead of saying the line where the error is says that "No module nameded XXX" what can make you go crazy if you've never had an error like this, a test file at www.sistrans.com/error_importing.zip


from the instructions.txt file in the .zip:

  In Summary:

  a)      When a module has problens it isn't loaded into memory behaves
        like if it weren't there. Moreover, Blender will show an advice
        saying that the module doesn't exist.

I suspect this comes from Python's new handling of modules: if a
module fails to load, it is cleaned up completely and not left in a
broken state.


  b)      When a module is right can loaded into memory but if the module
        is already loaded it won't be loaded into memory again even if
        it has changed.

This is standard python behavior.  Once a module has imported
successfully, to reload it, you need to do a reload: 

import foo
reload( foo )

-- 
Stephen Swaney			
sswaney at centurytel.net




More information about the Bf-python mailing list