[Python-checkins] r62133 - python/trunk/PCbuild/kill_python.c
trent.nelson
python-checkins at python.org
Thu Apr 3 22:00:08 CEST 2008
Author: trent.nelson
Date: Thu Apr 3 22:00:08 2008
New Revision: 62133
Modified:
python/trunk/PCbuild/kill_python.c
Log:
Make kill_python a little more forgiving if it can't obtain a snapshot of module information for a given python[_d].exe process. Failing here was too pessimistic; the python[_d].exe process may be owned by another user, which is the case in some buildbot environments.
Modified: python/trunk/PCbuild/kill_python.c
==============================================================================
--- python/trunk/PCbuild/kill_python.c (original)
+++ python/trunk/PCbuild/kill_python.c Thu Apr 3 22:00:08 2008
@@ -118,11 +118,15 @@
/* It's a python process, so figure out which directory it's in... */
hsm = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pe.th32ProcessID);
- if (hsm == INVALID_HANDLE_VALUE) {
- printf("CreateToolhelp32Snapshot[3] failed: %d\n", GetLastError());
- CloseHandle(hsp);
- return 1;
- }
+ if (hsm == INVALID_HANDLE_VALUE)
+ /*
+ * If our module snapshot fails (which will happen if we don't own
+ * the process), just ignore it and continue. (It seems different
+ * versions of Windows return different values for GetLastError()
+ * in this situation; it's easier to just ignore it and move on vs.
+ * stopping the build for what could be a false positive.)
+ */
+ continue;
if (!Module32FirstW(hsm, &me)) {
printf("Module32FirstW[2] failed: %d\n", GetLastError());
More information about the Python-checkins
mailing list