osutil: remove Python 2.4 errno conversion workaround
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 22 Jun 2015 10:11:31 -0700
changeset 25645 977102cb12fc
parent 25644 c99f9715cc9a
child 25646 57e7a060a06f
osutil: remove Python 2.4 errno conversion workaround
mercurial/pure/osutil.py
--- a/mercurial/pure/osutil.py	Mon Jun 22 10:09:08 2015 -0700
+++ b/mercurial/pure/osutil.py	Mon Jun 22 10:11:31 2015 -0700
@@ -59,7 +59,6 @@
     posixfile = open
 else:
     import ctypes, msvcrt
-    from errno import ESRCH, ENOENT
 
     _kernel32 = ctypes.windll.kernel32
 
@@ -99,14 +98,7 @@
 
     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