# HG changeset patch # User Sylvain Thénault # Date 1285757051 -7200 # Node ID 1b5fc8581437c2574def34783542819152257ed5 # Parent 843684a50e4808a474daee3a919c5efdec5d9b58 [c-c] fix RuntimeError: 'maximum recursion depth exceeded while calling a Python object' we get when creating/upgrading/shelling an instance: hasattr() call __getattribute__, creating an infinite recursion error catched by the interpretor. Avoid this by testing the method is available on the class instead of the instance diff -r 843684a50e48 -r 1b5fc8581437 migration.py --- a/migration.py Wed Sep 29 12:18:06 2010 +0200 +++ b/migration.py Wed Sep 29 12:44:11 2010 +0200 @@ -129,7 +129,8 @@ return object.__getattribute__(self, name) except AttributeError: cmd = 'cmd_%s' % name - if hasattr(self, cmd): + # search self.__class__ to avoid infinite recursion + if hasattr(self.__class__, cmd): meth = getattr(self, cmd) return lambda *args, **kwargs: self.interact(args, kwargs, meth=meth)