summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <julien.cristau@logilab.fr>2014-07-27 14:47:21 +0200
committerJulien Cristau <julien.cristau@logilab.fr>2014-07-27 14:47:21 +0200
commit16e1bd8858543582bc069a5d6c37c075fafa3461 (patch)
tree884812a43a593ed85268fbda315ee81f96e62e2b
parentc398cb4974931b3277d14543b3706fe06fdc3d1c (diff)
downloadlogilab-common-16e1bd8858543582bc069a5d6c37c075fafa3461.tar.gz
py3k: fix bool(nullobject)
The __nonzero__ method was replaced by __bool__.
-rw-r--r--__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/__init__.py b/__init__.py
index 7b06bb1..2d1324c 100644
--- a/__init__.py
+++ b/__init__.py
@@ -60,8 +60,9 @@ class dictattr(dict):
class nullobject(object):
def __repr__(self):
return '<nullobject>'
- def __nonzero__(self):
+ def __bool__(self):
return False
+ __nonzero__ = __bool__
class tempattr(object):
def __init__(self, obj, attr, value):