diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-02 18:13:59 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-02 18:13:59 +0100 |
commit | 1cff4c060559242beb908f0f53e8d511964c47f7 (patch) | |
tree | 7203bdcc391e63f6061bce0f977c0434baa492d5 | |
parent | 616f519b1f9f2d59e68eccea2f234b1c0e6ff5ed (diff) | |
download | psutil-1cff4c060559242beb908f0f53e8d511964c47f7.tar.gz |
small refactoring
-rw-r--r-- | psutil/arch/windows/global.h | 1 | ||||
-rwxr-xr-x | psutil/tests/test_windows.py | 9 |
2 files changed, 3 insertions, 7 deletions
diff --git a/psutil/arch/windows/global.h b/psutil/arch/windows/global.h index 10ae6405..d7a35b31 100644 --- a/psutil/arch/windows/global.h +++ b/psutil/arch/windows/global.h @@ -11,7 +11,6 @@ extern int PSUTIL_WINVER; extern SYSTEM_INFO PSUTIL_SYSTEM_INFO; -#define PSUTIL_WINDOWS_XP 51 #define PSUTIL_WINDOWS_SERVER_2003 52 #define PSUTIL_WINDOWS_VISTA 60 #define PSUTIL_WINDOWS_7 61 diff --git a/psutil/tests/test_windows.py b/psutil/tests/test_windows.py index 1075efdd..de12ff50 100755 --- a/psutil/tests/test_windows.py +++ b/psutil/tests/test_windows.py @@ -32,16 +32,13 @@ from psutil.tests import retry_on_failure from psutil.tests import sh from psutil.tests import unittest -with warnings.catch_warnings(): - warnings.simplefilter("ignore") - try: +if WINDOWS: + with warnings.catch_warnings(): + warnings.simplefilter("ignore") import win32api # requires "pip install pypiwin32" import win32con import win32process import wmi # requires "pip install wmi" / "make setup-dev-env" - except ImportError: - if os.name == 'nt': - raise cext = psutil._psplatform.cext |