summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--psutil/_pswindows.py3
-rwxr-xr-xpsutil/tests/test_linux.py3
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)]