diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2015-09-13 05:48:38 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2015-09-13 05:48:38 +0200 |
commit | e079f3c8feeeec70c1ea32491cf39721c1c82d15 (patch) | |
tree | 694a535d85ebd46c44ee943ad4d2e93a9e868a74 | |
parent | f60f3723ab8a2ba1798f38c4d8dbd456445d2fa8 (diff) | |
download | psutil-e079f3c8feeeec70c1ea32491cf39721c1c82d15.tar.gz |
FreeBSD: little refactoring + fix test
-rw-r--r-- | psutil/_psbsd.py | 8 | ||||
-rw-r--r-- | psutil/_psutil_bsd.c | 9 | ||||
-rw-r--r-- | test/test_psutil.py | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/psutil/_psbsd.py b/psutil/_psbsd.py index 58d1642a..82bf91f5 100644 --- a/psutil/_psbsd.py +++ b/psutil/_psbsd.py @@ -25,13 +25,13 @@ __extra__all__ = [] # --- constants PROC_STATUSES = { - cext.SSTOP: _common.STATUS_STOPPED, - cext.SSLEEP: _common.STATUS_SLEEPING, - cext.SRUN: _common.STATUS_RUNNING, cext.SIDL: _common.STATUS_IDLE, + cext.SRUN: _common.STATUS_RUNNING, + cext.SSLEEP: _common.STATUS_SLEEPING, + cext.SSTOP: _common.STATUS_STOPPED, + cext.SZOMB: _common.STATUS_ZOMBIE, cext.SWAIT: _common.STATUS_WAITING, cext.SLOCK: _common.STATUS_LOCKED, - cext.SZOMB: _common.STATUS_ZOMBIE, } TCP_STATUSES = { diff --git a/psutil/_psutil_bsd.c b/psutil/_psutil_bsd.c index 37459a23..69d473da 100644 --- a/psutil/_psutil_bsd.c +++ b/psutil/_psutil_bsd.c @@ -2233,13 +2233,14 @@ void init_psutil_bsd(void) PyModule_AddIntConstant(module, "version", PSUTIL_VERSION); // process status constants - PyModule_AddIntConstant(module, "SSTOP", SSTOP); - PyModule_AddIntConstant(module, "SSLEEP", SSLEEP); - PyModule_AddIntConstant(module, "SRUN", SRUN); PyModule_AddIntConstant(module, "SIDL", SIDL); + PyModule_AddIntConstant(module, "SRUN", SRUN); + PyModule_AddIntConstant(module, "SSLEEP", SSLEEP); + PyModule_AddIntConstant(module, "SSTOP", SSTOP); + PyModule_AddIntConstant(module, "SZOMB", SZOMB); PyModule_AddIntConstant(module, "SWAIT", SWAIT); PyModule_AddIntConstant(module, "SLOCK", SLOCK); - PyModule_AddIntConstant(module, "SZOMB", SZOMB); + // connection status constants PyModule_AddIntConstant(module, "TCPS_CLOSED", TCPS_CLOSED); PyModule_AddIntConstant(module, "TCPS_CLOSING", TCPS_CLOSING); diff --git a/test/test_psutil.py b/test/test_psutil.py index 2f000bef..df00e3d5 100644 --- a/test/test_psutil.py +++ b/test/test_psutil.py @@ -1245,7 +1245,7 @@ class TestProcess(unittest.TestCase): with mock.patch('psutil.os.kill', side_effect=OSError(errno.EPERM, "")) as fun: with self.assertRaises(psutil.AccessDenied): - p.send_signal(sig) + psutil.Process().send_signal(sig) assert fun.called def test_wait(self): |