summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2013-08-07 03:22:02 +0000
committerDaniel Dunbar <daniel@zuster.org>2013-08-07 03:22:02 +0000
commit304a0b03980996669ce2afc09b2bfe21381c5fdf (patch)
tree6bb58f4b830b6f5c669513279e86454f6812ef75 /utils
parent2e10ff28f24a26829ae9a43fc49b91eb974489ef (diff)
downloadllvm-304a0b03980996669ce2afc09b2bfe21381c5fdf.tar.gz
llvm-304a0b03980996669ce2afc09b2bfe21381c5fdf.tar.bz2
llvm-304a0b03980996669ce2afc09b2bfe21381c5fdf.tar.xz
[lit] Avoid __cmp__ and cmp().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/lit/lit/ShCommands.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/utils/lit/lit/ShCommands.py b/utils/lit/lit/ShCommands.py
index 431f0074a6..9ca9e8c91c 100644
--- a/utils/lit/lit/ShCommands.py
+++ b/utils/lit/lit/ShCommands.py
@@ -6,12 +6,12 @@ class Command:
def __repr__(self):
return 'Command(%r, %r)' % (self.args, self.redirects)
- def __cmp__(self, other):
+ def __eq__(self, other):
if not isinstance(other, Command):
- return -1
+ return False
- return cmp((self.args, self.redirects),
- (other.args, other.redirects))
+ return ((self.args, self.redirects) ==
+ (other.args, other.redirects))
def toShell(self, file):
for arg in self.args:
@@ -45,12 +45,12 @@ class Pipeline:
return 'Pipeline(%r, %r, %r)' % (self.commands, self.negate,
self.pipe_err)
- def __cmp__(self, other):
+ def __eq__(self, other):
if not isinstance(other, Pipeline):
- return -1
+ return False
- return cmp((self.commands, self.negate, self.pipe_err),
- (other.commands, other.negate, self.pipe_err))
+ return ((self.commands, self.negate, self.pipe_err) ==
+ (other.commands, other.negate, self.pipe_err))
def toShell(self, file, pipefail=False):
if pipefail != self.pipe_err:
@@ -72,12 +72,12 @@ class Seq:
def __repr__(self):
return 'Seq(%r, %r, %r)' % (self.lhs, self.op, self.rhs)
- def __cmp__(self, other):
+ def __eq__(self, other):
if not isinstance(other, Seq):
- return -1
+ return False
- return cmp((self.lhs, self.op, self.rhs),
- (other.lhs, other.op, other.rhs))
+ return ((self.lhs, self.op, self.rhs) ==
+ (other.lhs, other.op, other.rhs))
def toShell(self, file, pipefail=False):
self.lhs.toShell(file, pipefail)