From 4c5ee5fc21a9a07daadb37d8091bae6d271c0524 Mon Sep 17 00:00:00 2001 From: Tim Beyer <35711942+TimFelixBeyer@users.noreply.github.com> Date: Tue, 11 Jul 2023 23:46:22 +0200 Subject: [PATCH] Remove use of hasElement --- music21/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/music21/base.py b/music21/base.py index 124eb593c..a88ffa718 100644 --- a/music21/base.py +++ b/music21/base.py @@ -1256,7 +1256,7 @@ def purgeOrphans(self, excludeStorageStreams=True) -> None: # of the site does not actually have this Music21Object in # its elements list, it is an orphan and should be removed # note: this permits non-site context Streams to continue - if s.isStream and not s.hasElement(self): + if s.isStream and not self in s: if excludeStorageStreams: # only get those that are not Storage Streams if ('SpannerStorage' not in s.classes