Use bool() to simplify ObjectProxy.__nonzero__().
authorZac Medico <zmedico@gentoo.org>
Fri, 27 Jun 2008 06:44:29 +0000 (06:44 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 27 Jun 2008 06:44:29 +0000 (06:44 -0000)
svn path=/main/trunk/; revision=10810

pym/portage/util.py

index 821513ae67e01ee447f041766a5328a2c96db7d9..af99adedd04d5e09ea85235f55320bf1fc921c4e 100644 (file)
@@ -969,9 +969,7 @@ class ObjectProxy(object):
                return object.__getattribute__(self, '_get_target')() != other
 
        def __nonzero__(self):
-               if object.__getattribute__(self, '_get_target')():
-                       return True
-               return False
+               return bool(object.__getattribute__(self, '_get_target')())
 
 class LazyItemsDict(dict):
        """A mapping object that behaves like a standard dict except that it allows