Show More
@@ -212,7 +212,12 b' except AttributeError:' | |||||
212 | _kernel32.PeekNamedPipe.restype = _BOOL |
|
212 | _kernel32.PeekNamedPipe.restype = _BOOL | |
213 |
|
213 | |||
214 | def _raiseoserror(name): |
|
214 | def _raiseoserror(name): | |
215 | err = ctypes.WinError() |
|
215 | # Force the code to a signed int to avoid an 'int too large' error. | |
|
216 | # See https://bugs.python.org/issue28474 | |||
|
217 | code = _kernel32.GetLastError() | |||
|
218 | if code > 0x7fffffff: | |||
|
219 | code -= 2**32 | |||
|
220 | err = ctypes.WinError(code=code) | |||
216 | raise OSError(err.errno, '%s: %s' % (name, err.strerror)) |
|
221 | raise OSError(err.errno, '%s: %s' % (name, err.strerror)) | |
217 |
|
222 | |||
218 | def _getfileinfo(name): |
|
223 | def _getfileinfo(name): |
General Comments 0
You need to be logged in to leave comments.
Login now