diff --git a/beancount_import/source/generic_importer_source.py b/beancount_import/source/generic_importer_source.py index da0e458c..3e7ed5a9 100644 --- a/beancount_import/source/generic_importer_source.py +++ b/beancount_import/source/generic_importer_source.py @@ -48,7 +48,12 @@ def __init__(self, ) ] # filter the valid files for this importer - self.files = [f for f in files if self.importer.identify(f)] + # handle the fact that importer.identify could raise an exception + # instead of returning False, but that ultimately means False for this purpose + def try_identify(importer, file): + try: return importer.identify(file) + except: return False + self.files = [f for f in files if try_identify(self.importer, f ) ] @property def name(self) -> str: