Skip to content

Commit 08a3b42

Browse files
committed
Python 3 compatibility for missing / mock value
1 parent 51a39ee commit 08a3b42

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

roundup/cgi/templating.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3244,6 +3244,8 @@ def __bool__(self): return False
32443244
# Python 2 compatibility:
32453245
__nonzero__ = __bool__
32463246
def __contains__(self, key): return False
3247+
def __eq__(self, rhs): return False
3248+
def __ne__(self, rhs): return False
32473249
def __str__(self): return '[%s]'%self.__description
32483250
def __repr__(self): return '<MissingValue 0x%x "%s">'%(id(self),
32493251
self.__description)

test/mocknull.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def __bool__(self): return False
2020
# Python 2 compatibility:
2121
__nonzero__ = __bool__
2222
def __contains__(self, key): return False
23+
def __eq__(self, rhs): return False
24+
def __ne__(self, rhs): return False
2325
def __str__(self): return ''
2426
def __repr__(self): return '<MockNull 0x%x>'%id(self)
2527
def gettext(self, str): return str

0 commit comments

Comments
 (0)