Skip to content

Commit 508a82c

Browse files
author
Paul Sokolovsky
committed
webrepl_cli.py: Fix variable shadowing case.
1 parent ebe604c commit 508a82c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

webrepl_cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def recvexactly(self, sz):
4545
sz -= len(data)
4646
return res
4747

48-
def read(self, sz):
48+
def read(self, size):
4949
if not self.buf:
5050
while True:
5151
hdr = self.recvexactly(2)
@@ -66,8 +66,9 @@ def read(self, sz):
6666
assert len(data) == sz
6767
self.buf = data
6868

69-
d = self.buf[:sz]
70-
self.buf = self.buf[sz:]
69+
d = self.buf[:size]
70+
self.buf = self.buf[size:]
71+
assert len(d) == size, len(d)
7172
return d
7273

7374
def ioctl(self, req, val):

0 commit comments

Comments
 (0)