kopia lustrzana https://github.com/micropython/micropython-lib
multiprocessing: Fix from_bytes/to_bytes calls.
As they're used for internal communication, just use "little" for endianness.pull/121/merge
rodzic
1522d3eb15
commit
3e3c6fcaa6
|
@ -44,14 +44,14 @@ class Connection:
|
|||
|
||||
def send(self, obj):
|
||||
s = pickle.dumps(obj)
|
||||
self.f.write(len(s).to_bytes(4))
|
||||
self.f.write(len(s).to_bytes(4, "little"))
|
||||
self.f.write(s)
|
||||
|
||||
def recv(self):
|
||||
s = self.f.read(4)
|
||||
if not s:
|
||||
raise EOFError
|
||||
l = int.from_bytes(s)
|
||||
l = int.from_bytes(s, "little")
|
||||
s = self.f.read(l)
|
||||
if not s:
|
||||
raise EOFError
|
||||
|
|
Ładowanie…
Reference in New Issue