From 2ec484bb9f63f67ff1e102ebaef284223fc7a850 Mon Sep 17 00:00:00 2001 From: Amir MOHAMMADI <amir.mohammadi@idiap.ch> Date: Fri, 9 Mar 2018 15:51:36 +0100 Subject: [PATCH] Make missing annotations None instead of empty dict --- bob/bio/base/annotator/FailSafe.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bob/bio/base/annotator/FailSafe.py b/bob/bio/base/annotator/FailSafe.py index ebeeb8ac..caa57719 100644 --- a/bob/bio/base/annotator/FailSafe.py +++ b/bob/bio/base/annotator/FailSafe.py @@ -26,7 +26,7 @@ class FailSafe(Annotator): def annotate(self, sample, **kwargs): if 'annotations' not in kwargs or kwargs['annotations'] is None: - kwargs['annotations'] = {} + kwargs['annotations'] = None for annotator in self.annotators: try: annotations = annotator(sample, **kwargs) @@ -34,7 +34,7 @@ class FailSafe(Annotator): logger.debug( "The annotator `%s' failed to annotate!", annotator, exc_info=True) - annotations = {} + annotations = None if not annotations: logger.debug( "Annotator `%s' returned empty annotations.", annotator) @@ -44,5 +44,5 @@ class FailSafe(Annotator): break else: # this else is for the for loop # we don't want to return half of the annotations - kwargs['annotations'] = {} + kwargs['annotations'] = None return kwargs['annotations'] -- GitLab