diff --git a/src/stdlib/re.py b/src/stdlib/re.py index 3a87f43..b94bcd2 100644 --- a/src/stdlib/re.py +++ b/src/stdlib/re.py @@ -50,7 +50,7 @@ def search(self, text: str) -> str | None: result_bytes = cast(bytes, ffi.string(result)) return result_bytes.decode("utf-8") finally: - lib.free(ptr) + lib.free(ptr) # type: ignore[attr-defined] return None def findall(self, text: str) -> list[str]: @@ -68,7 +68,7 @@ def findall(self, text: str) -> list[str]: i += 1 finally: # Free the allocated memory - lib.free_matches(matches_ptr) + lib.free_matches(matches_ptr) # type: ignore[attr-defined] return matches def sub(self, replacement: str, text: str) -> str: @@ -82,7 +82,7 @@ def sub(self, replacement: str, text: str) -> str: result_bytes = cast(bytes, ffi.string(result)) return result_bytes.decode("utf-8") finally: - lib.free(ptr) + lib.free(ptr) # type: ignore[attr-defined] return text # Return the original text if substitution fails