From e92af9de59755417fd5891a183a521488ce531f8 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sat, 17 Nov 2012 23:16:07 +0100 Subject: [PATCH] pytholite/transel: use python3-compatible comparison methods --- migen/pytholite/transel.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/migen/pytholite/transel.py b/migen/pytholite/transel.py index ef172a759..d46b1998d 100644 --- a/migen/pytholite/transel.py +++ b/migen/pytholite/transel.py @@ -156,8 +156,23 @@ class Register: def __index__(self): return int(self._val) - def __cmp__(self, other): - return cmp(self._val, other) + def __lt__(self, other): + return self._val < other + + def __le__(self, other): + return self._val <= other + + def __eq__(self, other): + return self._val == other + + def __ge__(self, other): + return self._val >= other + + def __gt__(self, other): + return self._val > other + + def __ne__(self, other): + return self._val != other def __str__(self): return str(self._val)