Merge pull request #2042 from jepler/qstr-expansion
makeqstrdata: permit longer "compressed" outputs
This commit is contained in:
commit
47a0b7cba1
@ -180,7 +180,7 @@ def compress(encoding_table, decompressed):
|
||||
if not isinstance(decompressed, bytes):
|
||||
raise TypeError()
|
||||
values, lengths = encoding_table
|
||||
enc = bytearray(len(decompressed))
|
||||
enc = bytearray(len(decompressed) * 2)
|
||||
#print(decompressed)
|
||||
#print(lengths)
|
||||
current_bit = 7
|
||||
@ -227,6 +227,8 @@ def compress(encoding_table, decompressed):
|
||||
current_bit -= 1
|
||||
if current_bit != 7:
|
||||
current_byte += 1
|
||||
if current_byte > len(decompressed):
|
||||
print("Note: compression increased length", repr(decompressed.decode('utf-8')), len(decompressed), current_byte, file=sys.stderr)
|
||||
return enc[:current_byte]
|
||||
|
||||
def qstr_escape(qst):
|
||||
|
Loading…
Reference in New Issue
Block a user