[master 29/30] Fix two instances where check_equal() returned True incorrectly.
mulkieran
installerbot-noreply at redhat.com
Wed Mar 25 22:48:07 UTC 2015
From: mulhern <amulhern at redhat.com>
Signed-off-by: mulhern <amulhern at redhat.com>
---
tests/pylint/pointless-override.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tests/pylint/pointless-override.py b/tests/pylint/pointless-override.py
index 6f7160c..e5f0fd8 100644
--- a/tests/pylint/pointless-override.py
+++ b/tests/pylint/pointless-override.py
@@ -162,7 +162,8 @@ def check_equal(cls, node, other):
return len(node.elts) == len(other.elts) and \
all(cls.check_equal(n, o) for (n, o) in zip(node.elts, other.elts))
if isinstance(node, astroid.Dict):
- return len(node.items) == len(other.items)
+ return len(node.items) == len(other.items) and \
+ all(cls.check_equal(n, o) for (n, o) in zip(sorted(node.items), sorted(other.items)))
if isinstance(node, astroid.CallFunc):
if type(node.func) != type(other.func):
return False
@@ -180,7 +181,8 @@ def check_equal(cls, node, other):
return node.starargs == other.starargs and \
node.kwargs == other.kwargs and \
- all(cls.check_equal(n, o) for (n, o) in zip(node.args, other.args))
+ node.args == other.args
+
return False
@staticmethod
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/66daf6c573a1a11d44a012ac48b2086e7ece2792
More information about the anaconda-patches
mailing list