mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Fixed the negative value check in io._BytesIO.seek().
This commit is contained in:
parent
10dfc1ee31
commit
8130f7c3c4
1 changed files with 1 additions and 1 deletions
|
|
@ -831,9 +831,9 @@ def seek(self, pos, whence=0):
|
|||
except AttributeError as err:
|
||||
raise TypeError("an integer is required") from err
|
||||
if whence == 0:
|
||||
self._pos = max(0, pos)
|
||||
if pos < 0:
|
||||
raise ValueError("negative seek position %r" % (pos,))
|
||||
self._pos = max(0, pos)
|
||||
elif whence == 1:
|
||||
self._pos = max(0, self._pos + pos)
|
||||
elif whence == 2:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue