summaryrefslogtreecommitdiffstats
path: root/python/lasso.py
diff options
context:
space:
mode:
authorEmmanuel Raviart <eraviart@entrouvert.com>2004-08-27 14:41:09 +0000
committerEmmanuel Raviart <eraviart@entrouvert.com>2004-08-27 14:41:09 +0000
commit497181fc6a44388a91af7f08dbe411977e75c083 (patch)
treead6b587bf01cce9f2718270061c75ee0f020eafe /python/lasso.py
parenteaa4b813fcd0f7aa1152d98998afe5b59556142f (diff)
downloadlasso-497181fc6a44388a91af7f08dbe411977e75c083.tar.gz
lasso-497181fc6a44388a91af7f08dbe411977e75c083.tar.xz
lasso-497181fc6a44388a91af7f08dbe411977e75c083.zip
Corrected SWIG binding.
Corrected Python tests.
Diffstat (limited to 'python/lasso.py')
-rw-r--r--python/lasso.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/python/lasso.py b/python/lasso.py
index cd03230a..6d1a4e73 100644
--- a/python/lasso.py
+++ b/python/lasso.py
@@ -187,13 +187,16 @@ class _ObjectMixin(object):
def _setRegisteredClass(instance):
- cls = _registeredClasses.get(instance.__class__, None)
- if cls is None and instance.__class__.__name__.endswith('Ptr'):
- cls = _registeredClasses.get(instance.__class__.__bases__[0], None)
+ try:
+ instanceClass = instance.__class__
+ except AttributeError:
+ return
+ cls = _registeredClasses.get(instanceClass, None)
+ if cls is None and instanceClass.__name__.endswith('Ptr'):
+ cls = _registeredClasses.get(instanceClass.__bases__[0], None)
if cls is not None:
object.__setattr__(instance, '__class__', cls)
-
def registerClass(cls):
assert cls.lassomodClass
_registeredClasses[cls.lassomodClass] = cls