patch from Stani to prevent hasattr(bpy.ops, '__call__') being True
authorCampbell Barton <ideasman42@gmail.com>
Tue, 27 Oct 2009 15:25:27 +0000 (15:25 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 27 Oct 2009 15:25:27 +0000 (15:25 +0000)
release/scripts/modules/bpy_ops.py

index 240b0e2720a5918d38dc48b9c460a77587c3d031..c8269e25049d197f0ab6a1bacbd3cad4cd775779 100644 (file)
@@ -21,21 +21,24 @@ context_dict = {
 class bpy_ops(object):
        '''
        Fake module like class.
-       
+
         bpy.ops
        '''
-       def add(self, pyop):
-               op_add(pyop)
-       
-       def remove(self, pyop):
-               op_remove(pyop)
-       
+
        def __getattr__(self, module):
                '''
                gets a bpy.ops submodule
                '''
+               if module.startswith('__'):
+                       raise AttributeError(module)
                return bpy_ops_submodule(module)
                
+       def add(self, pyop):
+               op_add(pyop)
+       
+       def remove(self, pyop):
+               op_remove(pyop)
+       
        def __dir__(self):
                
                submodules = set()