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):
"""Because __cmp__ calls cmp(self, other)
and if self contains set instance, it fails.
"""
if isinstance(other, (UserDict.DictMixin, dict)):
for item_self, item_other in itertools.izip_longest(
self.iteritems(),
other.iteritems()):
if item_self != item_other:
return False
return True
else:
try:
b = other.items()
except StandardError:
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):
......
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