diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-07-19 11:57:34 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-07-19 11:57:34 +0200 |
commit | 89422841e46efa99bda49acfbe33ee1ca5122845 (patch) | |
tree | 4d0d54f2d8a0af7b557d4e51263a3923d885ea24 /lib/git/remote.py | |
parent | 3d9310055f364cf3fa97f663287c596920d6e7e5 (diff) | |
download | gitpython-89422841e46efa99bda49acfbe33ee1ca5122845.tar.gz |
index: Fixed bug which caused incorrect separators in output files of the return value
remote: fixed evil bug that was caused by some inconsistency of python when __getattr__ and __slots__ are invovled - namely it calles getattr before checking for a slot of the same name, in an alternating fashion
Diffstat (limited to 'lib/git/remote.py')
-rw-r--r-- | lib/git/remote.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/git/remote.py b/lib/git/remote.py index 8c75b1db..54e1b210 100644 --- a/lib/git/remote.py +++ b/lib/git/remote.py @@ -7,6 +7,7 @@ from exc import GitCommandError from objects import Commit +from ConfigParser import NoOptionError from git.util import ( LazyMixin, @@ -435,7 +436,13 @@ class Remote(LazyMixin, Iterable): if attr == "_config_reader": return super(Remote, self).__getattr__(attr) - return self._config_reader.get(attr) + # sometimes, probably due to a bug in python itself, we are being called + # even though a slot of the same name exists + try: + return self._config_reader.get(attr) + except NoOptionError: + return super(Remote, self).__getattr__(attr) + # END handle exception def _config_section_name(self): return 'remote "%s"' % self.name |