We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea66786 commit 907f0b7Copy full SHA for 907f0b7
lib/matplotlib/dviread.py
@@ -392,16 +392,10 @@ def _read(self):
392
393
def _arg(self, nbytes, signed=False):
394
"""
395
- Read and return an integer argument *nbytes* long.
+ Read and return a big-endian integer *nbytes* long.
396
Signedness is determined by the *signed* keyword.
397
398
- buf = self.file.read(nbytes)
399
- value = buf[0]
400
- if signed and value >= 0x80:
401
- value = value - 0x100
402
- for b in buf[1:]:
403
- value = 0x100*value + b
404
- return value
+ return int.from_bytes(self.file.read(nbytes), "big", signed=signed)
405
406
@_dispatch(min=0, max=127, state=_dvistate.inpage)
407
def _set_char_immediate(self, char):
0 commit comments