Skip to content

Commit 1a57669

Browse files
committed
change to run on python 3.13
1 parent 0a3cf2c commit 1a57669

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

abc_search.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
r'\%\%beginps(.|\s)+?\%\%endps', # remove embedded postscript
1010
r'\%\%begintext(.|\s)+?\%\%endtext', # remove text
1111
r'\[\w:.*?\]', # remove embedded fields
12-
r'(?m)^\w:.*?$', # remove normal fields
13-
r'(?m)%.*$', # remove comments
12+
#r'(?m)^\w:.*?$', # remove normal fields
13+
r'^\w:.*?$', # remove normal fields
14+
#r'(?m)%.*$', # remove comments
15+
r'%.*$', # remove comments
1416
r'\[\w:.*?\]', # remove embedded fields
1517
r'\\"', # remove escaped " characters
1618
r'".*?"', # remove strings
@@ -19,7 +21,7 @@
1921
r'!.+?!', # remove ornaments like eg. !pralltriller!
2022
r'\+.+?\+', # remove ornaments like eg. +pralltriller+
2123
r'\{.*?\}', # remove grace notes
22-
]))
24+
]), flags=re.M)
2325

2426
def remove_non_note_fragments(abc):
2527
# replace non-note fragments of the text by replacing them by spaces (thereby preserving offsets), but keep also bar and repeat symbols

tune_elements.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ class AbcStructure(object):
10811081
@staticmethod
10821082
def get_sections(cwd):
10831083
# [1.3.6.2 [JWDJ] bugfix This fixes 'str>ng' in Fields and Command Reference
1084-
reference_content = io.open(os.path.join(cwd, 'reference.txt'), 'rU', encoding='latin-1').read()
1084+
reference_content = io.open(os.path.join(cwd, 'reference.txt'), 'r', encoding='latin-1').read()
10851085
if AbcStructure.replace_regexes is None:
10861086
AbcStructure.replace_regexes = [
10871087
(re.compile(r'\bh((?:bass/chord|length|logical|string|int|fl-?\n?oat\s?|command|str|text|vol|h|n|char|clef|bass|chord)\d*\s?(?: (?:string|int|float)\d*?)*)i\b'), r'<\1>'), # enclose types with < and >

0 commit comments

Comments
 (0)