diff --git a/biblib/bib.py b/biblib/bib.py index 495ab87..a52a91b 100644 --- a/biblib/bib.py +++ b/biblib/bib.py @@ -90,11 +90,16 @@ def parse(self, str_or_fp_or_iter, name=None, *, log_fp=None): defined in earlier files. """ + try: + from collections.abc import Iterable as collections_Iterable + except AttributeError: + from collections import Iterable as collections_Iterable # does not work in python3.10 anymore + recoverer = messages.InputErrorRecoverer() if isinstance(str_or_fp_or_iter, str): self.__data = str_or_fp_or_iter fname = name or '' - elif isinstance(str_or_fp_or_iter, collections.Iterable) and \ + elif isinstance(str_or_fp_or_iter, collections_Iterable) and \ not hasattr(str_or_fp_or_iter, 'read'): for obj in str_or_fp_or_iter: with recoverer: