Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(30)

Side by Side Diff: Python/errors.c

Issue 3871: cross and native build of python for mingw32 with distutils
Patch Set: Created 7 years, 2 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Python/dynamic_annotations.c ('k') | Python/fileblocks.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* Error handling */ 2 /* Error handling */
3 3
4 #include "Python.h" 4 #include "Python.h"
5 5
6 #ifndef __STDC__ 6 #ifndef __STDC__
7 #ifndef MS_WINDOWS 7 #ifndef MS_WINDOWS
8 extern char *strerror(int); 8 extern char *strerror(int);
9 #endif 9 #endif
10 #endif 10 #endif
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 MAKELANGID(LANG_NEUTRAL, 417 MAKELANGID(LANG_NEUTRAL,
418 SUBLANG_DEFAULT), 418 SUBLANG_DEFAULT),
419 /* Default language */ 419 /* Default language */
420 (LPWSTR) &s_buf, 420 (LPWSTR) &s_buf,
421 0, /* size not used */ 421 0, /* size not used */
422 NULL); /* no args */ 422 NULL); /* no args */
423 if (len==0) { 423 if (len==0) {
424 /* Only ever seen this in out-of-mem 424 /* Only ever seen this in out-of-mem
425 situations */ 425 situations */
426 s_buf = NULL; 426 s_buf = NULL;
427 message = PyUnicode_FromFormat("Windows Error 0x%X", i); 427 message = PyUnicode_FromFormat("Windows Error 0x%x", i);
428 } else { 428 } else {
429 /* remove trailing cr/lf and dots */ 429 /* remove trailing cr/lf and dots */
430 while (len > 0 && (s_buf[len-1] <= L' ' || s_buf[len-1] == L'.') ) 430 while (len > 0 && (s_buf[len-1] <= L' ' || s_buf[len-1] == L'.') )
431 s_buf[--len] = L'\0'; 431 s_buf[--len] = L'\0';
432 message = PyUnicode_FromWideChar(s_buf, len); 432 message = PyUnicode_FromWideChar(s_buf, len);
433 } 433 }
434 } 434 }
435 } 435 }
436 #endif /* Unix/Windows */ 436 #endif /* Unix/Windows */
437 437
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 FORMAT_MESSAGE_IGNORE_INSERTS, 512 FORMAT_MESSAGE_IGNORE_INSERTS,
513 NULL, /* no message source */ 513 NULL, /* no message source */
514 err, 514 err,
515 MAKELANGID(LANG_NEUTRAL, 515 MAKELANGID(LANG_NEUTRAL,
516 SUBLANG_DEFAULT), /* Default language */ 516 SUBLANG_DEFAULT), /* Default language */
517 (LPWSTR) &s_buf, 517 (LPWSTR) &s_buf,
518 0, /* size not used */ 518 0, /* size not used */
519 NULL); /* no args */ 519 NULL); /* no args */
520 if (len==0) { 520 if (len==0) {
521 /* Only seen this in out of mem situations */ 521 /* Only seen this in out of mem situations */
522 message = PyUnicode_FromFormat("Windows Error 0x%X", err); 522 message = PyUnicode_FromFormat("Windows Error 0x%x", err);
523 s_buf = NULL; 523 s_buf = NULL;
524 } else { 524 } else {
525 /* remove trailing cr/lf and dots */ 525 /* remove trailing cr/lf and dots */
526 while (len > 0 && (s_buf[len-1] <= L' ' || s_buf[len-1] == L'.')) 526 while (len > 0 && (s_buf[len-1] <= L' ' || s_buf[len-1] == L'.'))
527 s_buf[--len] = L'\0'; 527 s_buf[--len] = L'\0';
528 message = PyUnicode_FromWideChar(s_buf, len); 528 message = PyUnicode_FromWideChar(s_buf, len);
529 } 529 }
530 530
531 if (message == NULL) 531 if (message == NULL)
532 { 532 {
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 if (res == NULL) 973 if (res == NULL)
974 PyErr_Clear(); 974 PyErr_Clear();
975 return res; 975 return res;
976 } 976 }
977 return NULL; 977 return NULL;
978 } 978 }
979 979
980 #ifdef __cplusplus 980 #ifdef __cplusplus
981 } 981 }
982 #endif 982 #endif
OLDNEW
« no previous file with comments | « Python/dynamic_annotations.c ('k') | Python/fileblocks.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+