Skip to content

Commit bed7c7f

Browse files
authored
Fix type checker errors (#9)
1 parent 067d0a0 commit bed7c7f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/stdlib/re.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def search(self, text: str) -> str | None:
5050
result_bytes = cast(bytes, ffi.string(result))
5151
return result_bytes.decode("utf-8")
5252
finally:
53-
lib.free(ptr)
53+
lib.free(ptr) # type: ignore[attr-defined]
5454
return None
5555

5656
def findall(self, text: str) -> list[str]:
@@ -68,7 +68,7 @@ def findall(self, text: str) -> list[str]:
6868
i += 1
6969
finally:
7070
# Free the allocated memory
71-
lib.free_matches(matches_ptr)
71+
lib.free_matches(matches_ptr) # type: ignore[attr-defined]
7272
return matches
7373

7474
def sub(self, replacement: str, text: str) -> str:
@@ -82,7 +82,7 @@ def sub(self, replacement: str, text: str) -> str:
8282
result_bytes = cast(bytes, ffi.string(result))
8383
return result_bytes.decode("utf-8")
8484
finally:
85-
lib.free(ptr)
85+
lib.free(ptr) # type: ignore[attr-defined]
8686
return text # Return the original text if substitution fails
8787

8888

0 commit comments

Comments
 (0)