File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,17 +137,20 @@ def lzw_decode(data, code_size):
137137 """Decode LZW-compressed data."""
138138 dictionary = LZWDict (code_size )
139139 bit = 0
140- byte = next (data ) # pylint: disable=stop-iteration-return
141140 try :
142- while True :
143- code = 0
144- for i in range (dictionary .code_len ):
145- code |= ((byte >> bit ) & 0x01 ) << i
146- bit += 1
147- if bit >= 8 :
148- bit = 0
149- byte = next (data ) # pylint: disable=stop-iteration-return
150- yield dictionary .decode (code )
151- except EndOfData :
152- while True :
153- next (data ) # pylint: disable=stop-iteration-return
141+ byte = next (data ) # pylint: disable=stop-iteration-return
142+ try :
143+ while True :
144+ code = 0
145+ for i in range (dictionary .code_len ):
146+ code |= ((byte >> bit ) & 0x01 ) << i
147+ bit += 1
148+ if bit >= 8 :
149+ bit = 0
150+ byte = next (data ) # pylint: disable=stop-iteration-return
151+ yield dictionary .decode (code )
152+ except EndOfData :
153+ while True :
154+ next (data ) # pylint: disable=stop-iteration-return
155+ except StopIteration :
156+ pass
You can’t perform that action at this time.
0 commit comments