[Python-3000-checkins] r62845 - python/branches/py3k/Lib/io.py
Nick Coghlan
ncoghlan at gmail.com
Thu May 8 14:13:50 CEST 2008
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?
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
More information about the Python-3000-checkins
mailing list