summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-11-12 04:54:13 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-11-12 04:54:13 +0100
commit8bb5b98f42355297ae7f00de6e1ebcc960430bbf (patch)
tree68ca029439f25d38224cbf944763acc0c468f609
parent9acbea183405dd0c70d3ddb1e12560f6624b0476 (diff)
downloadpsutil-8bb5b98f42355297ae7f00de6e1ebcc960430bbf.tar.gz
enable PSUTIL_DEBUG for tests
-rw-r--r--Makefile2
-rw-r--r--psutil/_psutil_windows.c6
-rwxr-xr-xscripts/internal/winmake.py1
3 files changed, 8 insertions, 1 deletions
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'
# ===================================================================