MINGW-packages/mingw-w64-python-psutil/0003-avoid-duplicate-symbols.patch
2024-01-31 18:15:58 +01:00

54 lines
1.4 KiB
Diff

--- a/psutil/_psutil_windows.c
+++ b/psutil/_psutil_windows.c
@@ -33,6 +33,8 @@
#include "arch/windows/sys.h"
#include "arch/windows/wmi.h"
+PyObject *TimeoutExpired;
+PyObject *TimeoutAbandoned;
// ------------------------ Python init ---------------------------
--- a/psutil/arch/windows/proc.c
+++ b/psutil/arch/windows/proc.c
@@ -31,8 +31,8 @@
// Raised by Process.wait().
-PyObject *TimeoutExpired;
-PyObject *TimeoutAbandoned;
+PyObject *TimeoutExpired2;
+PyObject *TimeoutAbandoned2;
/*
@@ -168,14 +168,14 @@
return NULL;
}
if (retVal == WAIT_TIMEOUT) {
- PyErr_SetString(TimeoutExpired,
+ PyErr_SetString(TimeoutExpired2,
"WaitForSingleObject() returned WAIT_TIMEOUT");
CloseHandle(hProcess);
return NULL;
}
if (retVal == WAIT_ABANDONED) {
psutil_debug("WaitForSingleObject() -> WAIT_ABANDONED");
- PyErr_SetString(TimeoutAbandoned,
+ PyErr_SetString(TimeoutAbandoned2,
"WaitForSingleObject() returned WAIT_ABANDONED");
CloseHandle(hProcess);
return NULL;
--- a/psutil/arch/windows/proc.h
+++ b/psutil/arch/windows/proc.h
@@ -6,9 +6,6 @@
#include <Python.h>
-PyObject *TimeoutExpired;
-PyObject *TimeoutAbandoned;
-
PyObject *psutil_pid_exists(PyObject *self, PyObject *args);
PyObject *psutil_pids(PyObject *self, PyObject *args);
PyObject *psutil_ppid_map(PyObject *self, PyObject *args);