diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/getcopyright.c | 2 | ||||
-rw-r--r-- | Python/pythonrun.c | 22 |
2 files changed, 20 insertions, 4 deletions
diff --git a/Python/getcopyright.c b/Python/getcopyright.c index df70e8b..8864cdb 100644 --- a/Python/getcopyright.c +++ b/Python/getcopyright.c @@ -4,7 +4,7 @@ static char cprt[] = "\ -Copyright (c) 2001-2008 Python Software Foundation.\n\ +Copyright (c) 2001-2009 Python Software Foundation.\n\ All Rights Reserved.\n\ \n\ Copyright (c) 2000 BeOpen.com.\n\ diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 54f3c57..f2cd819 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -22,6 +22,10 @@ #include <signal.h> #endif +#ifdef MS_WINDOWS +#include "malloc.h" /* for alloca */ +#endif + #ifdef HAVE_LANGINFO_H #include <locale.h> #include <langinfo.h> @@ -1628,9 +1632,21 @@ Py_FatalError(const char *msg) { fprintf(stderr, "Fatal Python error: %s\n", msg); #ifdef MS_WINDOWS - OutputDebugString("Fatal Python error: "); - OutputDebugString(msg); - OutputDebugString("\n"); + { + size_t len = strlen(msg); + WCHAR* buffer; + size_t i; + + /* Convert the message to wchar_t. This uses a simple one-to-one + conversion, assuming that the this error message actually uses ASCII + only. If this ceases to be true, we will have to convert. */ + buffer = alloca( (len+1) * (sizeof *buffer)); + for( i=0; i<=len; ++i) + buffer[i] = msg[i]; + OutputDebugStringW(L"Fatal Python error: "); + OutputDebugStringW(buffer); + OutputDebugStringW(L"\n"); + } #ifdef _DEBUG DebugBreak(); #endif |