File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class Error(Exception):
3838# Various constants
3939REASONABLY_LARGE = 32768 # Minimal amount we pass the rle-coder
4040LINELEN = 64
41- RUNCHAR = chr ( 0x90 ) # run-length introducer
41+ RUNCHAR = b" \x90 "
4242
4343#
4444# This code is no longer byte-order dependent
@@ -351,11 +351,11 @@ def _fill(self, wtd):
351351 # otherwise: keep 1 byte.
352352 #
353353 mark = len (self .pre_buffer )
354- if self .pre_buffer [- 3 :] == RUNCHAR + '\0 ' + RUNCHAR :
354+ if self .pre_buffer [- 3 :] == RUNCHAR + b '\0 ' + RUNCHAR :
355355 mark = mark - 3
356356 elif self .pre_buffer [- 1 ] == RUNCHAR :
357357 mark = mark - 2
358- elif self .pre_buffer [- 2 :] == RUNCHAR + '\0 ' :
358+ elif self .pre_buffer [- 2 :] == RUNCHAR + b '\0 ' :
359359 mark = mark - 2
360360 elif self .pre_buffer [- 2 ] == RUNCHAR :
361361 pass # Decode all
Original file line number Diff line number Diff line change @@ -31,13 +31,13 @@ class NoEOFStringIO(io.BytesIO):
3131 """
3232 def read (self , n = - 1 ):
3333 data = io .BytesIO .read (self , n )
34- if data == '' :
34+ if data == b '' :
3535 raise AssertionError ('caller tried to read past EOF' )
3636 return data
3737
3838 def readline (self , length = None ):
3939 data = io .BytesIO .readline (self , length )
40- if data == '' :
40+ if data == b '' :
4141 raise AssertionError ('caller tried to read past EOF' )
4242 return data
4343
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ class Error(Exception):
8484
8585# Determine endian-ness
8686import struct
87- if struct .pack ("h" , 1 ) == "\000 \001 " :
87+ if struct .pack ("h" , 1 ) == b "\000 \001 " :
8888 big_endian = 1
8989else :
9090 big_endian = 0
You can’t perform that action at this time.
0 commit comments