1 |
commit: 3777bae98ef47c8416426dfc5a3c60b013fceaa9 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 29 06:18:45 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 29 06:18:45 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=3777bae9 |
7 |
|
8 |
Fix SpaceSepFrozenSet[]. |
9 |
|
10 |
--- |
11 |
gentoopm/util.py | 6 +++++- |
12 |
1 files changed, 5 insertions(+), 1 deletions(-) |
13 |
|
14 |
diff --git a/gentoopm/util.py b/gentoopm/util.py |
15 |
index 168c7ac..32cf156 100644 |
16 |
--- a/gentoopm/util.py |
17 |
+++ b/gentoopm/util.py |
18 |
@@ -113,7 +113,11 @@ class StringCompat(StringifiedComparisons): |
19 |
class _SpaceSepIter(object): |
20 |
def __getitem__(self, k): |
21 |
if isinstance(k, str): |
22 |
- return self[self.index(k)] |
23 |
+ for i in self: |
24 |
+ if i == k: |
25 |
+ return i |
26 |
+ else: |
27 |
+ raise KeyError('No item matches %s' % repr(k)) |
28 |
return tuple.__getitem__(self, k) |
29 |
|
30 |
def __str__(self): |