Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/stdlib/re.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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:
Expand All @@ -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


Expand Down