Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cf4021a

Browse files
authored
Merge pull request #16876 from anntzer/dviread
Small cleanups to dviread.
2 parents 8ba451b + 8f498f4 commit cf4021a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/matplotlib/dviread.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ def _arg_raw(dvi, delta):
7373
return delta
7474

7575

76-
def _arg(bytes, signed, dvi, _):
76+
def _arg(nbytes, signed, dvi, _):
7777
"""
78-
Read *bytes* bytes, returning the bytes interpreted as a signed integer
78+
Read *nbytes* bytes, returning the bytes interpreted as a signed integer
7979
if *signed* is true, unsigned otherwise.
8080
"""
81-
return dvi._arg(bytes, signed)
81+
return dvi._arg(nbytes, signed)
8282

8383

8484
def _arg_slen(dvi, delta):
@@ -315,12 +315,12 @@ def _arg(self, nbytes, signed=False):
315315
Read and return an integer argument *nbytes* long.
316316
Signedness is determined by the *signed* keyword.
317317
"""
318-
str = self.file.read(nbytes)
319-
value = str[0]
318+
buf = self.file.read(nbytes)
319+
value = buf[0]
320320
if signed and value >= 0x80:
321321
value = value - 0x100
322-
for i in range(1, nbytes):
323-
value = 0x100*value + str[i]
322+
for b in buf[1:]:
323+
value = 0x100*value + b
324324
return value
325325

326326
@_dispatch(min=0, max=127, state=_dvistate.inpage)

0 commit comments

Comments
 (0)