From b82e233c48503f0997b67186c92fa02e41827a84 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola Date: Thu, 14 Oct 2021 19:23:27 +0200 Subject: add tests Signed-off-by: Giampaolo Rodola --- psutil/_pslinux.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'psutil/_pslinux.py') diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 4fce35a7..73fe71ed 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1244,17 +1244,17 @@ class RootFsDeviceFinder: if path is None: try: path = self.use_proc_partitions() - except FileNotFoundError as err: + except OSError as err: debug(err) if path is None: try: path = self.use_sys_dev_block() - except FileNotFoundError as err: + except OSError as err: debug(err) if path is None: try: path = self.use_sys_class_block() - except FileNotFoundError as err: + except OSError as err: debug(err) return path @@ -1282,8 +1282,7 @@ def disk_partitions(all=False): retlist = [] partitions = cext.disk_partitions(mounts_path) - for partition in partitions: - device, mountpoint, fstype, opts = partition + for device, mountpoint, fstype, opts in partitions: if device == 'none': device = '' if device in ("/dev/root", "rootfs"): -- cgit v1.2.1