From: Sebastien Bourdeauducq Date: Sat, 17 Nov 2012 22:16:07 +0000 (+0100) Subject: pytholite/transel: use python3-compatible comparison methods X-Git-Tag: 24jan2021_ls180~2099^2~774 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e92af9de59755417fd5891a183a521488ce531f8;p=litex.git pytholite/transel: use python3-compatible comparison methods --- diff --git a/migen/pytholite/transel.py b/migen/pytholite/transel.py index ef172a75..d46b1998 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)