make regex more flexible for different quotation marks (#22629)

This commit is contained in:
Christian Baars 2024-12-12 11:21:47 +01:00 committed by GitHub
parent dc7cb05cab
commit 6268066bac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -53,7 +53,7 @@ def addEntryToModtab(source):
is_module = False is_module = False
pattern = (r'''(?<=module\()[^"].*''') # module?? pattern = (r'''(?<=module\([\"\']).*[\"\']''') # module??
result = re.findall(pattern,code) result = re.findall(pattern,code)
if len(result) > 0: if len(result) > 0:
class_name = result[0].replace("'","").replace('"','').replace(")","") class_name = result[0].replace("'","").replace('"','').replace(")","")