summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb.py
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/ldb.py')
-rw-r--r--source4/lib/ldb/ldb.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/source4/lib/ldb/ldb.py b/source4/lib/ldb/ldb.py
index 2d037f080c..6aacc8c09c 100644
--- a/source4/lib/ldb/ldb.py
+++ b/source4/lib/ldb/ldb.py
@@ -101,12 +101,15 @@ class ldb_msg_element(object):
return ret
def __eq__(self, other):
- if (isinstance(other, str) and
- len(set(self)) == 1 and
- set(self).pop() == other):
+ if (len(self) == 1 and self.get(0) == other):
return True
- return self.__cmp__(other) == 0
-
+ if isinstance(other, self.__class__):
+ return self.__cmp__(other) == 0
+ o = iter(other)
+ for i in range(len(self)):
+ if self.get(i) != o.next():
+ return False
+ return True
ldb_msg_element.__iter__ = new_instancemethod(_ldb.ldb_msg_element___iter__,None,ldb_msg_element)
ldb_msg_element.__set__ = new_instancemethod(_ldb.ldb_msg_element___set__,None,ldb_msg_element)