From 7c39462ae6c8d178dc338944a2480a48838e19a3 Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Thu, 2 Jun 2016 01:07:02 -0400 Subject: [PATCH] add a __bool__ to Results in db.py --- beets/dbcore/db.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/beets/dbcore/db.py b/beets/dbcore/db.py index 1c6d066c3..a07a19997 100644 --- a/beets/dbcore/db.py +++ b/beets/dbcore/db.py @@ -593,6 +593,11 @@ class Results(object): return self._row_count def __nonzero__(self): + """Does this result contain any objects? + """ + return self.__bool__() + + def __bool__(self): """Does this result contain any objects? """ return bool(len(self))