Mercurial > cpython-lru_cache-weakref
diff PC/generrmap.c @ 38153:e2ef60fec3da legacy-trunk
Change WindowsError to carry the Win32 error code in winerror,
and the DOS error code in errno. Revert changes where
WindowsError catch blocks unnecessarily special-case OSError.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Thu, 11 May 2006 13:28:43 +0000 |
| parents | |
| children | fd25030223b0 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PC/generrmap.c Thu May 11 13:28:43 2006 +0000 @@ -0,0 +1,20 @@ +#include <stdio.h> +#include <errno.h> + +/* Extract the mapping of Win32 error codes to errno */ + +int main() +{ + int i; + printf("/* Generated file. Do not edit. */\n"); + printf("int winerror_to_errno(int winerror)\n"); + printf("{\n\tswitch(winerror) {\n"); + for(i=1; i < 65000; i++) { + _dosmaperr(i); + if (errno == EINVAL) + continue; + printf("\t\tcase %d: return %d;\n", i, errno); + } + printf("\t\tdefault: return EINVAL;\n"); + printf("\t}\n}\n"); +}
