From 8bb5b98f42355297ae7f00de6e1ebcc960430bbf Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Sun, 12 Nov 2017 04:54:13 +0100 Subject: enable PSUTIL_DEBUG for tests --- Makefile | 2 +- psutil/_psutil_windows.c | 6 ++++++ scripts/internal/winmake.py | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e8ff51ca..7b2eca86 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ DEPS = \ # In not in a virtualenv, add --user options for install commands. INSTALL_OPTS = `$(PYTHON) -c "import sys; print('' if hasattr(sys, 'real_prefix') else '--user')"` -TEST_PREFIX = PYTHONWARNINGS=all PSUTIL_TESTING=1 +TEST_PREFIX = PYTHONWARNINGS=all PSUTIL_TESTING=1 PSUTIL_DEBUG=1 all: test diff --git a/psutil/_psutil_windows.c b/psutil/_psutil_windows.c index 574885b6..d9129322 100644 --- a/psutil/_psutil_windows.c +++ b/psutil/_psutil_windows.c @@ -341,6 +341,8 @@ psutil_proc_kill(PyObject *self, PyObject *args) { if (hProcess == NULL) { if (GetLastError() == ERROR_INVALID_PARAMETER) { // see https://github.com/giampaolo/psutil/issues/24 + psutil_debug("OpenProcess -> ERROR_INVALID_PARAMETER turned " + "into NoSuchProcess"); NoSuchProcess(); } else { @@ -2409,10 +2411,14 @@ psutil_disk_io_counters(PyObject *self, PyObject *args) { // 1364/job/ascpdi271b06jle3 // Assume it means we're dealing with some exotic disk // and go on. + psutil_debug("DeviceIoControl -> ERROR_INVALID_FUNCTION; " + "ignore a disk"); goto next; } else if (GetLastError() == ERROR_NOT_SUPPORTED) { // Again, let's assume we're dealing with some exotic disk. + psutil_debug("DeviceIoControl -> ERROR_NOT_SUPPORTED; " + "ignore a disk"); goto next; } // XXX: it seems we should also catch ERROR_INVALID_PARAMETER: diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py index 35ce059c..548f7a8e 100755 --- a/scripts/internal/winmake.py +++ b/scripts/internal/winmake.py @@ -177,6 +177,7 @@ def recursive_rm(*patterns): def test_setup(): os.environ['PYTHONWARNINGS'] = 'all' os.environ['PSUTIL_TESTING'] = '1' + os.environ['PSUTIL_DEBUG'] = '1' # =================================================================== -- cgit v1.2.1