diff test/mocknull.py @ 5404:3757449e00c4

Python 3 preparation: use __bool__ instead of __nonzero__. Tool-assisted patch. __nonzero__ = __bool__ included for Python 2 compatibility.
author Joseph Myers <jsm@polyomino.org.uk>
date Tue, 24 Jul 2018 23:50:25 +0000
parents 79fd8537ae3b
children a35d4cc8cd1a
line wrap: on
line diff
--- a/test/mocknull.py	Tue Jul 24 23:49:13 2018 +0000
+++ b/test/mocknull.py	Tue Jul 24 23:50:25 2018 +0000
@@ -16,7 +16,9 @@
         return getattr(self, name)
 
     def __getitem__(self, key): return self
-    def __nonzero__(self): return 0
+    def __bool__(self): return 0
+    # Python 2 compatibility:
+    __nonzero__ = __bool__
     def __str__(self): return ''
     def __repr__(self): return '<MockNull 0x%x>'%id(self)
     def gettext(self, str): return str

Roundup Issue Tracker: http://roundup-tracker.org/