py/modstruct: In struct.pack, stop converting if there are no args left.

This patch makes a repeat counter behave the same as repeating the
typecode, when there are not enough args.  For example:
struct.pack('2I', 1) now behave the same as struct.pack('II', 1).
This commit is contained in:
Damien George
2017-09-01 10:10:51 +10:00
parent b349479a49
commit 793d826d9d
3 changed files with 6 additions and 1 deletions

View File

@@ -1 +1,2 @@
True
b'\x01\x00\x00\x00\x00\x00\x00\x00'