fix: fixes regex pattern to get property dependencies

This commit is contained in:
Mose Müller 2025-05-22 11:55:19 +02:00
parent 61b69d77cc
commit f92d525588

View File

@ -22,7 +22,7 @@ def reverse_dict(original_dict: dict[str, list[str]]) -> dict[str, list[str]]:
def get_property_dependencies(prop: property, prefix: str = "") -> list[str]: def get_property_dependencies(prop: property, prefix: str = "") -> list[str]:
source_code_string = inspect.getsource(prop.fget) # type: ignore[arg-type] source_code_string = inspect.getsource(prop.fget) # type: ignore[arg-type]
pattern = r"self\.([^\s\{\}]+)" pattern = r"self\.([^\s\{\}\)]+)"
matches = re.findall(pattern, source_code_string) matches = re.findall(pattern, source_code_string)
return [prefix + match for match in matches if "(" not in match] return [prefix + match for match in matches if "(" not in match]