diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-11-12 04:54:13 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-11-12 04:54:13 +0100 |
commit | 8bb5b98f42355297ae7f00de6e1ebcc960430bbf (patch) | |
tree | 68ca029439f25d38224cbf944763acc0c468f609 | |
parent | 9acbea183405dd0c70d3ddb1e12560f6624b0476 (diff) | |
download | psutil-8bb5b98f42355297ae7f00de6e1ebcc960430bbf.tar.gz |
enable PSUTIL_DEBUG for tests
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | psutil/_psutil_windows.c | 6 | ||||
-rwxr-xr-x | scripts/internal/winmake.py | 1 |
3 files changed, 8 insertions, 1 deletions
@@ -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' # =================================================================== |