Show More
@@ -59,7 +59,6 b" if os.name != 'nt':" | |||||
59 | posixfile = open |
|
59 | posixfile = open | |
60 | else: |
|
60 | else: | |
61 | import ctypes, msvcrt |
|
61 | import ctypes, msvcrt | |
62 | from errno import ESRCH, ENOENT |
|
|||
63 |
|
62 | |||
64 | _kernel32 = ctypes.windll.kernel32 |
|
63 | _kernel32 = ctypes.windll.kernel32 | |
65 |
|
64 | |||
@@ -99,14 +98,7 b' else:' | |||||
99 |
|
98 | |||
100 | def _raiseioerror(name): |
|
99 | def _raiseioerror(name): | |
101 | err = ctypes.WinError() |
|
100 | err = ctypes.WinError() | |
102 | # For python 2.4, treat ESRCH as ENOENT like WindowsError does |
|
101 | raise IOError(err.errno, '%s: %s' % (name, err.strerror)) | |
103 | # in python 2.5 or later. |
|
|||
104 | # py24: WindowsError(3, '').errno => 3 |
|
|||
105 | # py25 or later: WindowsError(3, '').errno => 2 |
|
|||
106 | errno = err.errno |
|
|||
107 | if errno == ESRCH: |
|
|||
108 | errno = ENOENT |
|
|||
109 | raise IOError(errno, '%s: %s' % (name, err.strerror)) |
|
|||
110 |
|
102 | |||
111 | class posixfile(object): |
|
103 | class posixfile(object): | |
112 | '''a file object aiming for POSIX-like semantics |
|
104 | '''a file object aiming for POSIX-like semantics |
General Comments 0
You need to be logged in to leave comments.
Login now