migration.py
branchstable
changeset 6362 1b5fc8581437
parent 6221 a5cc5dc15f9d
child 6657 402bff898024
equal deleted inserted replaced
6361:843684a50e48 6362:1b5fc8581437
   127     def __getattribute__(self, name):
   127     def __getattribute__(self, name):
   128         try:
   128         try:
   129             return object.__getattribute__(self, name)
   129             return object.__getattribute__(self, name)
   130         except AttributeError:
   130         except AttributeError:
   131             cmd = 'cmd_%s' % name
   131             cmd = 'cmd_%s' % name
   132             if hasattr(self, cmd):
   132             # search self.__class__ to avoid infinite recursion
       
   133             if hasattr(self.__class__, cmd):
   133                 meth = getattr(self, cmd)
   134                 meth = getattr(self, cmd)
   134                 return lambda *args, **kwargs: self.interact(args, kwargs,
   135                 return lambda *args, **kwargs: self.interact(args, kwargs,
   135                                                              meth=meth)
   136                                                              meth=meth)
   136             raise
   137             raise
   137         raise AttributeError(name)
   138         raise AttributeError(name)