[Python-3000-checkins] r62845 - python/branches/py3k/Lib/io.py

Alexandre Vassalotti alexandre at peadrop.com
Fri May 9 21:17:41 CEST 2008


On Thu, May 8, 2008 at 8:13 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> alexandre.vassalotti wrote:
>>
>> Author: alexandre.vassalotti
>> Date: Thu May  8 03:39:38 2008
>> New Revision: 62845
>>
>> Log:
>> Fixed the negative value check in io._BytesIO.seek().
>>
>>
>> Modified:
>>   python/branches/py3k/Lib/io.py
>>
>> Modified: python/branches/py3k/Lib/io.py
>>
>> ==============================================================================
>> --- python/branches/py3k/Lib/io.py      (original)
>> +++ python/branches/py3k/Lib/io.py      Thu May  8 03:39:38 2008
>> @@ -831,9 +831,9 @@
>>         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)
>
> Doesn't the ValueError make the max() call redundant?

Indeed. Thank you, Nick, for catching this.

-- Alexandre


More information about the Python-3000-checkins mailing list