Skip to content

Commit 4f21a64

Browse files
DimitriPapadopoulosmattip
authored andcommitted
Apply ruff/flake8-simplify rule SIM101
SIM101 Multiple `isinstance` calls for `tp`, merge into a single call
1 parent 2079ca7 commit 4f21a64

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/cffi/recompiler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,7 @@ def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode):
538538
tovar, errcode)
539539
return
540540
#
541-
elif (isinstance(tp, model.StructOrUnionOrEnum) or
542-
isinstance(tp, model.BasePrimitiveType)):
541+
elif (isinstance(tp, (model.StructOrUnionOrEnum, model.BasePrimitiveType))):
543542
# a struct (not a struct pointer) as a function argument;
544543
# or, a complex (the same code works)
545544
self._prnt(' if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)'

0 commit comments

Comments
 (0)