From 3bcf70a99728f189aceb1a3c31c57f07a51cfcc0 Mon Sep 17 00:00:00 2001 From: HotNoob Date: Tue, 30 Jul 2024 20:20:29 -0500 Subject: [PATCH] fix pytest deprecation warnings --- classes/protocol_settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/protocol_settings.py b/classes/protocol_settings.py index a51982f..6549109 100644 --- a/classes/protocol_settings.py +++ b/classes/protocol_settings.py @@ -343,7 +343,7 @@ def determine_delimiter(first_row) -> str: if first_row.count(';') < first_row.count(','): delimeter = ',' - first_row = re.sub(r"\s+" + re.escape(delimeter) +"|" + re.escape(delimeter) +"\s+", delimeter, first_row) #trim values + first_row = re.sub(r"\s+" + re.escape(delimeter) +"|" + re.escape(delimeter) +r"\s+", delimeter, first_row) #trim values csvfile = itertools.chain([first_row], csvfile) #add clean header to begining of iterator @@ -379,7 +379,7 @@ def determine_delimiter(first_row) -> str: variable_name = row['variable name'] if row['variable name'] else row['documented name'] variable_name = variable_name = variable_name.strip().lower().replace(' ', '_').replace('__', '_') #clean name - if re.search("[^a-zA-Z0-9\_]", variable_name) : + if re.search(r"[^a-zA-Z0-9\_]", variable_name) : print("WARNING Invalid Name : " + str(variable_name) + " reg: " + str(row['register']) + " doc name: " + str(row['documented name']) + " path: " + str(path)) #convert to float @@ -913,7 +913,7 @@ def validate_registry_entry(self, entry : registry_map_entry, val) -> int: return 0 if entry.data_type == Data_Type.ASCII: - if val and not re.match('[^a-zA-Z0-9\_\-]', val): #validate ascii + if val and not re.match(r'[^a-zA-Z0-9\_\-]', val): #validate ascii if entry.value_regex: #regex validation if re.match(entry.value_regex, val): if entry.concatenate: