From 6c92c1ce1fa348d1cba7cd1567bf20700be8013b Mon Sep 17 00:00:00 2001
From: Manuel Gunther <siebenkopf@googlemail.com>
Date: Fri, 10 Nov 2017 10:06:12 -0700
Subject: [PATCH] Turned exception of missing ZT files into a warning

---
 bob/bio/base/database/filelist/query.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/bob/bio/base/database/filelist/query.py b/bob/bio/base/database/filelist/query.py
index 2d6eaf13..c3454093 100644
--- a/bob/bio/base/database/filelist/query.py
+++ b/bob/bio/base/database/filelist/query.py
@@ -10,6 +10,9 @@ from .. import BioFile
 
 from .models import ListReader
 
+import logging
+logger = logging.getLogger('bob.bio.base')
+
 
 class FileListBioDatabase(ZTBioDatabase):
     """This class provides a user-friendly interface to databases that are given as file lists.
@@ -226,10 +229,12 @@ class FileListBioDatabase(ZTBioDatabase):
             if group == 'world':
                 continue
             if add_zt_files:
-                if not self.implements_zt(self.protocol, group):
-                    raise ValueError("ZT score files are requested, but no such files are defined in group %s for protocol %s", group, self.protocol)
-                files += self.tobjects(group, self.protocol)
-                files += self.zobjects(group, self.protocol, **self.z_probe_options)
+                if self.implements_zt(self.protocol, group):
+                    files += self.tobjects(group, self.protocol)
+                    files += self.zobjects(group, self.protocol, **self.z_probe_options)
+                else:
+                    logger.warn("ZT score files are requested, but no such files are defined in group %s for protocol %s", group, self.protocol)
+
         return self.sort(self._make_bio(files))
 
 
-- 
GitLab