Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion biblib/bib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<string>'
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:
Expand Down