Commit 08dd9385 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Fix option comparison in case they are not in the same order

parent 02e0a757
...@@ -1605,15 +1605,15 @@ class Options(UserDict.DictMixin): ...@@ -1605,15 +1605,15 @@ class Options(UserDict.DictMixin):
"""Because __cmp__ calls cmp(self, other) """Because __cmp__ calls cmp(self, other)
and if self contains set instance, it fails. and if self contains set instance, it fails.
""" """
if isinstance(other, (UserDict.DictMixin, dict)): try:
for item_self, item_other in itertools.izip_longest( b = other.items()
self.iteritems(), except StandardError:
other.iteritems()):
if item_self != item_other:
return False
return True
else:
return super(Options, self).__eq__(other) return super(Options, self).__eq__(other)
# BBB: Note such sorting would not work with python3
a = self.items()
a.sort()
b.sort()
return a == b
def _convert_bool(name, value): def _convert_bool(name, value):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment