[PATCH] osutil: remove Python 2.4 errno conversion workaround

Augie Fackler raf at durin42.com
Mon Jun 22 17:50:10 CDT 2015


On Mon, Jun 22, 2015 at 10:12:55AM -0700, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1434993091 25200
> #      Mon Jun 22 10:11:31 2015 -0700
> # Node ID f3727ed787bf01618ea75dab25eca86bbfd647ba
> # Parent  2af150f19ecdc93659d81a644b5aa1f417167647
> osutil: remove Python 2.4 errno conversion workaround

Queued, thanks.

>
> diff --git a/mercurial/pure/osutil.py b/mercurial/pure/osutil.py
> --- a/mercurial/pure/osutil.py
> +++ b/mercurial/pure/osutil.py
> @@ -98,16 +98,9 @@ else:
>      _kernel32.CreateFileA.restype = _HANDLE
>
>      def _raiseioerror(name):
>          err = ctypes.WinError()
> -        # For python 2.4, treat ESRCH as ENOENT like WindowsError does
> -        # in python 2.5 or later.
> -        # py24:           WindowsError(3, '').errno => 3
> -        # py25 or later:  WindowsError(3, '').errno => 2
> -        errno = err.errno
> -        if errno == ESRCH:
> -            errno = ENOENT
> -        raise IOError(errno, '%s: %s' % (name, err.strerror))
> +        raise IOError(err.errno, '%s: %s' % (name, err.strerror))
>
>      class posixfile(object):
>          '''a file object aiming for POSIX-like semantics
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list