diff --git a/bob/db/replaymobile/query.py b/bob/db/replaymobile/query.py
index 751f72f81f4705ab97379050a37ff4b5f414ef28..96c75443ad0ba179a51bfdfa4a43dbab3e7c0d42 100644
--- a/bob/db/replaymobile/query.py
+++ b/bob/db/replaymobile/query.py
@@ -35,10 +35,7 @@ class Database(Database):
         #   which might fail in some conditions, e.g., when this destructor is called during the exit of the python interpreter
         self.session.close()
         self.session.bind.dispose()
-      except TypeError:
-        # ... I can just ignore the according exception...
-        pass
-      except AttributeError:
+      except Exception:
         pass
 
   def connect(self):