[PATCH] osutil: remove Python 2.4 errno conversion workaround
Gregory Szorc
gregory.szorc at gmail.com
Mon Jun 22 17:12:55 UTC 2015
# 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
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
More information about the Mercurial-devel
mailing list