From 2293d83675039249aef080b46503d9f4189c01aa Mon Sep 17 00:00:00 2001 From: David Martinez Date: Tue, 8 Mar 2022 10:45:34 +0100 Subject: [PATCH] fix: read annotation --- openvariant/find/find.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openvariant/find/find.py b/openvariant/find/find.py index d31ee59..c9a1560 100644 --- a/openvariant/find/find.py +++ b/openvariant/find/find.py @@ -38,9 +38,12 @@ def _find_files(base_path: str, annotation: Annotation or None, fix: bool) -> Ge if isfile(file_path): if annotation is not None: - for ext, _ in annotation.structure.items(): - if _check_extension(ext, file_path): - yield file_path, annotation + try: + for ext, _ in annotation.structure.items(): + if _check_extension(ext, file_path): + yield file_path, annotation + except AttributeError: + raise AttributeError("Unable to parse annotation file, check its location.") else: for f, a in _find_files(file_path, annotation, fix): yield f, a