diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 18:10:20 +0100 |
|---|---|---|
| committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-02-11 18:10:20 +0100 |
| commit | 1ec2f2ec0c7e751f3c68eca477c197690b4c2667 (patch) | |
| tree | 9e3aeadb98be410f045d99f686853f3067e03b6e | |
| parent | 00a339886a63887e1abb225d62827ff2d961a75f (diff) | |
| download | psutil-1ec2f2ec0c7e751f3c68eca477c197690b4c2667.tar.gz | |
small refact
| -rw-r--r-- | docs/index.rst | 2 | ||||
| -rw-r--r-- | psutil/_pslinux.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/docs/index.rst b/docs/index.rst index 27560da6..97dce444 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -405,7 +405,7 @@ Disks [sdiskpart(device='/dev/sda3', mountpoint='/', fstype='ext4', opts='rw,errors=remount-ro'), sdiskpart(device='/dev/sda7', mountpoint='/home', fstype='ext4', opts='rw')] - .. versionchanged:: 5.7.0 swap partitions are returned on Linux. + .. versionchanged:: 5.7.0 swap partitions are shown on Linux. .. function:: disk_usage(path) diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 60941589..ea1a8a08 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -1186,9 +1186,8 @@ def disk_partitions(all=False): pass else: with f: - lines = f.readlines() - lines.pop(0) # header - for line in lines: + f.readline() # header + for line in f.readlines(): fields = line.split('\t') device = fields[0].split()[0] mountp = None |
