From 22606d961f52314e5a9c42324d6a40f8725bdae6 Mon Sep 17 00:00:00 2001 From: Florent Date: Tue, 18 Mar 2014 12:02:26 +0100 Subject: [PATCH] Rewrite the empty function according to the new NotLoaded and the new NotAvailableType... --- weboob/capabilities/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weboob/capabilities/base.py b/weboob/capabilities/base.py index 95aa159e..dbe2d069 100644 --- a/weboob/capabilities/base.py +++ b/weboob/capabilities/base.py @@ -41,8 +41,10 @@ def empty(value): :rtype: :class:`bool` """ - for cls in (None, NotLoaded, NotAvailable): - if value is cls: + if value is None: + return True + for cls in (NotLoadedType, NotAvailableType): + if type(value) is cls: return True return False