Skip to content

Commit 7128af1

Browse files
authored
Merge pull request #385 from corteva/syntax_warning_fix_issue_384
Fix SyntaxWarnings on mzml regex strings (#384)
2 parents f01c6f7 + e1fb303 commit 7128af1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pymzml/file_classes/standardMzml.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,10 @@ def get_data_indices(fh, chunksize=8192, lookback_size=100):
382382
chromcnt = 0
383383
speccnt = 0
384384
# regexes to be used
385-
chromexp = re.compile(b'<\s*chromatogram[^>]*id="([^"]*)"')
386-
chromcntexp = re.compile(b'<\s*chromatogramList\s*count="([^"]*)"')
387-
specexp = re.compile(b'<\s*spectrum[^>]*id="([^"]*)"')
388-
speccntexp = re.compile(b'<\s*spectrumList\s*count="([^"]*)"')
385+
chromexp = re.compile(b'<\\s*chromatogram[^>]*id="([^"]*)"')
386+
chromcntexp = re.compile(b'<\\s*chromatogramList\\s*count="([^"]*)"')
387+
specexp = re.compile(b'<\\s*spectrum[^>]*id="([^"]*)"')
388+
speccntexp = re.compile(b'<\\s*spectrumList\\s*count="([^"]*)"')
389389
# go to start of file
390390
fh.seek(0)
391391
prev_chunk = ""
@@ -733,7 +733,7 @@ def _search_string_identifier(self, search_string, chunk_size=8):
733733
# NOTE: This needs to go intp regex_patterns.py
734734

735735
regex_string = re.compile(
736-
'<\s*spectrum[^>]*index="[0-9]+"\sid="({0})"\sdefaultArrayLength="[0-9]+">'.format(
736+
'<\\s*spectrum[^>]*index="[0-9]+"\\sid="({0})"\\sdefaultArrayLength="[0-9]+">'.format(
737737
"".join([".*", search_string, ".*"])
738738
).encode()
739739
)

0 commit comments

Comments
 (0)