Skip to content

Commit

Permalink
Fixes _pack_ being returned as a float (#282)
Browse files Browse the repository at this point in the history
This is going to require a new release to be made ASAP. When the packing is set to a  float ctypes raises an error stating that the pack value has to be a non-negative number.
  • Loading branch information
kdschlosser authored Mar 1, 2022
1 parent 39da7c3 commit b47bea7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion comtypes/tools/codegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ def calc_packing(struct, fields):
else:
if pack is None:
return None
return pack/8

return int(pack / 8)

raise PackingError("PACKING FAILED: %s" % details)

class PackingError(Exception):
Expand Down

0 comments on commit b47bea7

Please sign in to comment.