summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS4
-rw-r--r--Python/dynload_win.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index bd98e38..fc1c810 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,10 @@ What's New in Python 2.6 alpha 1?
Core and builtins
-----------------
+- Improve some exception messages when Windows fails to load an extension
+ module. Now we get for example '%1 is not a valid Win32 application' instead
+ of 'error code 193'.
+
- Bug #1481296: Fixed long(float('nan'))!=0L.
- Issue #1640: Added math.isinf(x), math.isnan(x) and math.copysign(x, y)
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
index fc641b9..98ebccb 100644
--- a/Python/dynload_win.c
+++ b/Python/dynload_win.c
@@ -194,7 +194,8 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname,
errorCode = GetLastError();
theLength = FormatMessage(
- FORMAT_MESSAGE_FROM_SYSTEM, /* flags */
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS, /* flags */
NULL, /* message source */
errorCode, /* the message (error) ID */
0, /* default language environment */