rclkar/python3: small simplifications
This commit is contained in:
parent
d9afcdf8a3
commit
b8fa3005dd
@ -43,14 +43,12 @@ htmltemplate = '''
|
||||
</html>
|
||||
'''
|
||||
|
||||
nlbytes = b'\n'
|
||||
bsbytes = b'\\'
|
||||
PY3 = sys.version > '3'
|
||||
if PY3:
|
||||
nlbytes = bytes('\n', encoding='iso-8859-1')
|
||||
bsbytes = bytes('\\', encoding='iso-8859-1')
|
||||
nullchar = 0
|
||||
else:
|
||||
nlbytes = '\n'
|
||||
bsbytes = '\\'
|
||||
nullchar = chr(0)
|
||||
|
||||
class KarTextExtractor:
|
||||
|
||||
@ -39,8 +39,7 @@ if PY3:
|
||||
def next_byte_as_int(data):
|
||||
return next(data)
|
||||
def next_byte_as_char(data):
|
||||
ret = bytes([next(data)])
|
||||
return ret
|
||||
return bytes([next(data)])
|
||||
else:
|
||||
def next_byte_as_int(data):
|
||||
return ord(data.next())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user