From 8028a861572887dbb2c94b73dd78867e1e7a8aaa Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert <michael.asato.cuthbert@gmail.com> Date: Tue, 27 Jun 2023 11:56:35 -1000 Subject: [PATCH] lint and flake --- music21/common/stringTools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/music21/common/stringTools.py b/music21/common/stringTools.py index 7daddd72c..8e18a12d3 100644 --- a/music21/common/stringTools.py +++ b/music21/common/stringTools.py @@ -435,7 +435,7 @@ def parenthesesMatch( * New in v9.3. ''' - if not len(open) or not len(close): + if not open or not close: raise ValueError('Neither open nor close can be empty.') mainMatch = ParenthesesMatch(-1, -1, '', []) @@ -446,13 +446,13 @@ def parenthesesMatch( i = 0 while i < len(s): if (not lastCharWasBackslash - and s[i:i+len(open)] == open): + and s[i:i + len(open)] == open): curPM = ParenthesesMatch(i + len(open), -1, '', []) stack.append(curPM) i += len(open) continue elif (not lastCharWasBackslash - and s[i:i+len(close)] == close): + and s[i:i + len(close)] == close): if len(stack) <= 1: raise ValueError(f'Closing {close!r} without {open!r} at index {i}.') curPM = stack.pop() @@ -473,8 +473,8 @@ def parenthesesMatch( return mainMatch.nested -# ----------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- if __name__ == '__main__': import music21 music21.mainTest()