diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 14:04:13 -0800 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 14:04:13 -0800 |
commit | 8daac74154f23bf1c663a90c95839b6eefe3dc6c (patch) | |
tree | cb46fc9c1d42d7681a79be303292ee47b33d40b9 | |
parent | 6233060092bf3822c2d6252ebe5a6ac521f7795c (diff) | |
parent | 24eb30167d5e9ec2d939bf80fccea239bac4458e (diff) | |
download | psutil-pypy.tar.gz |
Merge branch 'pypy' of https://github.com/giampaolo/psutil into pypypypy
-rw-r--r-- | psutil/_pswindows.py | 3 | ||||
-rwxr-xr-x | psutil/tests/test_linux.py | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py index c2cdbb85..d8abf2e6 100644 --- a/psutil/_pswindows.py +++ b/psutil/_pswindows.py @@ -928,9 +928,6 @@ class Process(object): @wrap_exceptions def create_time(self): - # special case for kernel process PIDs; return system boot time - if self.pid in (0, 4): - return boot_time() try: return cext.proc_create_time(self.pid) except OSError as err: diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index 4736bd6b..5a48a445 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -1070,6 +1070,9 @@ class TestSystemDiskPartitions(unittest.TestCase): @unittest.skipIf(not os.path.exists('/proc/swaps'), "/proc/swaps not available") def test_swap(self): + with open('/proc/swaps') as f: + if not f.readline() or not f.readlines(): + raise self.skipTest("/proc/swaps is empty") types = [x.fstype for x in psutil.disk_partitions(all=False)] self.assertNotIn('swap', types) types = [x.fstype for x in psutil.disk_partitions(all=True)] |