diff --git a/pygit2/config.py b/pygit2/config.py index 4cf636078..880ac74ed 100644 --- a/pygit2/config.py +++ b/pygit2/config.py @@ -62,9 +62,8 @@ def next(self): def __next__(self): entry = self._next_entry() name = ffi.string(entry.name).decode('utf-8') - value = ffi.string(entry.value).decode('utf-8') - return name, value + return name class ConfigMultivarIterator(ConfigIterator): @@ -130,7 +129,7 @@ def __contains__(self, key): def __getitem__(self, key): val = self._get_string(key) - return ffi.string(val).decode() + return ffi.string(val).decode('utf-8') def __setitem__(self, key, value): assert_string(key, "key") diff --git a/test/test_config.py b/test/test_config.py index 9787c3e13..7f8b4cece 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -173,8 +173,8 @@ def test_iterator(self): config = self.repo.config lst = {} - for name, value in config: - lst[name] = value + for name in config: + lst[name] = config[name] self.assertTrue('core.bare' in lst) self.assertTrue(lst['core.bare'])