Skip to content

Commit edd62fd

Browse files
committed
support python 3.11 w/ generator type hint
1 parent e47fc42 commit edd62fd

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • ci/check_c_abi/check_c_abi

ci/check_c_abi/check_c_abi/abi.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ class AbiError(msgspec.Struct):
213213
location: Optional[SymbolLocation] = None
214214

215215

216-
def _analyze_function_abi(old_abi: Abi, new_abi: Abi) -> Generator[AbiError]:
216+
def _analyze_function_abi(
217+
old_abi: Abi, new_abi: Abi
218+
) -> Generator[AbiError, None, None]:
217219
"""This iterates over every function in the existing abi, and make sure that no functions
218220
have been removed or had function parameters removed, parameters added or the type of any
219221
parameter changed. Note: adding new functions to the new abi is allowed
@@ -266,7 +268,9 @@ def _analyze_function_abi(old_abi: Abi, new_abi: Abi) -> Generator[AbiError]:
266268
)
267269

268270

269-
def _analyze_struct_abi(old_abi: Abi, new_abi: Abi) -> Generator[AbiError]:
271+
def _analyze_struct_abi(
272+
old_abi: Abi, new_abi: Abi
273+
) -> Generator[AbiError, None, None]:
270274
"""Checks to see if any existing structures have had items removed, reordered, renamed, or types
271275
changed (adding new members is considered to be ok, as long as functions are initialized via
272276
a create factory function)
@@ -307,7 +311,9 @@ def _analyze_struct_abi(old_abi: Abi, new_abi: Abi) -> Generator[AbiError]:
307311
)
308312

309313

310-
def _analyze_enum_abi(old_abi: Abi, new_abi: Abi) -> Generator[AbiError]:
314+
def _analyze_enum_abi(
315+
old_abi: Abi, new_abi: Abi
316+
) -> Generator[AbiError, None, None]:
311317
# flatten enum values: since values inside an enum in C are in the global scope
312318
old_enum_values = {
313319
k: (v, enum) for enum in old_abi.enums for k, v in enum.values

0 commit comments

Comments
 (0)