diff options
author | Florian Apolloner <florian@apolloner.eu> | 2008-06-07 11:36:57 +0200 |
---|---|---|
committer | Florian Apolloner <florian@apolloner.eu> | 2008-06-07 11:36:57 +0200 |
commit | 24effa4861d6d1e8cffe848ae63fa2ed40be03f6 (patch) | |
tree | 3ccc095fdfba18b96defee98cfe6fe03ef086cf8 /lib/git/method_missing.py | |
parent | 3d203a0da0c709d301e973a9fe3569efd1fb2bd3 (diff) | |
download | gitpython-24effa4861d6d1e8cffe848ae63fa2ed40be03f6.tar.gz |
fixed up the getattr stuff
Diffstat (limited to 'lib/git/method_missing.py')
-rw-r--r-- | lib/git/method_missing.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/git/method_missing.py b/lib/git/method_missing.py index 51ff8326..06414cc4 100644 --- a/lib/git/method_missing.py +++ b/lib/git/method_missing.py @@ -5,16 +5,13 @@ class MethodMissingMixin(object): This was `taken from a blog post <http://blog.iffy.us/?p=43>`_ """ def __getattr__(self, attr): - try: - return object.__getattribute__(self, attr) - except: - class MethodMissing(object): - def __init__(self, wrapped, method): - self.__wrapped__ = wrapped - self.__method__ = method - def __call__(self, *args, **kwargs): - return self.__wrapped__.method_missing(self.__method__, *args, **kwargs) - return MethodMissing(self, attr) + class MethodMissing(object): + def __init__(self, wrapped, method): + self.__wrapped__ = wrapped + self.__method__ = method + def __call__(self, *args, **kwargs): + return self.__wrapped__.method_missing(self.__method__, *args, **kwargs) + return MethodMissing(self, attr) def method_missing(self, *args, **kwargs): """ This method should be overridden in the derived class. """ |