Skip to content

Commit 34e445b

Browse files
A better fix for that regression; don't let 'continue' complete a spanner!
1 parent 86993ad commit 34e445b

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

music21/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
'''
5151
from __future__ import annotations
5252

53-
__version__ = '9.6.0b13'
53+
__version__ = '9.6.0b15'
5454

5555
def get_version_tuple(vv):
5656
v = vv.split('.')

music21/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<class 'music21.base.Music21Object'>
2828
2929
>>> music21.VERSION_STR
30-
'9.6.0b13'
30+
'9.6.0b15'
3131
3232
Alternatively, after doing a complete import, these classes are available
3333
under the module "base":

music21/musicxml/xmlToM21.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4517,20 +4517,24 @@ def xmlOneSpanner(self, mxObj, target, spannerClass, *, allowDuplicateIds=False)
45174517
su.placement = placement
45184518
self.spannerBundle.append(su)
45194519

4520+
if target is None:
4521+
return su
4522+
45204523
# add a reference of this note to this spanner
4521-
priorLength = len(su)
4522-
if target is not None:
4523-
typeAttr = mxObj.get('type')
4524+
typeAttr = mxObj.get('type')
4525+
if typeAttr in ('start', 'stop'):
4526+
priorLength = len(su)
45244527
if typeAttr == 'start':
45254528
su.insertFirstSpannedElement(target)
45264529
synchronizeIds(mxObj, su)
45274530
elif typeAttr == 'stop':
45284531
su.addSpannedElements(target)
4532+
if priorLength == 1:
4533+
su.completeStatus = True
4534+
# only add after complete
4535+
45294536
# environLocal.printDebug(['adding n', target, id(target), 'su.getSpannedElements',
45304537
# su.getSpannedElements(), su.getSpannedElementIds()])
4531-
if priorLength == 1:
4532-
su.completeStatus = True
4533-
# only add after complete
45344538

45354539
return su
45364540

0 commit comments

Comments
 (0)