use floor division
This commit is contained in:
parent
65a0156412
commit
eece2ae7a5
|
@ -56,7 +56,7 @@ class CounterAppContext():
|
|||
return "", 0
|
||||
h = encode_big_endian(self.txCount, 8)
|
||||
h.reverse()
|
||||
return str(h), 0
|
||||
return h.decode(), 0
|
||||
|
||||
def commit(self):
|
||||
self.commitCount += 1
|
||||
|
|
|
@ -165,9 +165,7 @@ class TMSPServer():
|
|||
self.handle_conn_closed(r)
|
||||
return
|
||||
except Exception as e:
|
||||
import sys
|
||||
print(sys.exc_info()[0])
|
||||
print("error reading from connection", str(e))
|
||||
logger.exception("error reading from connection")
|
||||
self.handle_conn_closed(r)
|
||||
return
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ def uvarint_size(i):
|
|||
def encode_big_endian(i, size):
|
||||
if size == 0:
|
||||
return bytearray()
|
||||
return encode_big_endian(i / 256, size - 1) + bytearray([i % 256])
|
||||
return encode_big_endian(i // 256, size - 1) + bytearray([i % 256])
|
||||
|
||||
|
||||
def decode_big_endian(reader, size):
|
||||
|
|
Loading…
Reference in New Issue