From bd6198058a3ec1a5331930b60378e3f4685a2a03 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Henryk=20Pl=C3=B6tz?= Date: Sat, 8 Sep 2018 21:15:19 +0200 Subject: [PATCH] Use duck typing to break dependency hell --- fints/types.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fints/types.py b/fints/types.py index a44a015..e6e6b4a 100644 --- a/fints/types.py +++ b/fints/types.py @@ -170,10 +170,9 @@ class SegmentSequence: if recurse: for name, field in s._fields.items(): - if isinstance(field, fints.fields.SegmentSequenceField): - val = getattr(s, name) - if val: - yield from val.find_segments(query=query, version=version, callback=callback, recurse=recurse) + val = getattr(s, name) + if val and hasattr(val, 'find_segments'): + yield from val.find_segments(query=query, version=version, callback=callback, recurse=recurse) def find_segment_first(self, *args, **kwargs): """Finds the first matching segment. -- 2.47.3