Skip to content

Commit

Permalink
Fix Proc.cmdline and Proc.cpuinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardobranco777 committed Nov 19, 2023
1 parent 2456e1f commit 10b7bb6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions procfs/procfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,12 @@ def _cgroups(self) -> AttrDict:
}
)

def _cmdline(self) -> str:
def _cmdline(self) -> list[str]:
"""
Parses /proc/cmdline and returns a list
Parses /proc/cmdline and returns a list of strings
"""
with open("cmdline", opener=self._opener, encoding="utf-8") as file:
return file.read().strip()
return file.read().strip().split()

def _cpuinfo(self) -> list[AttrDict]:
"""
Expand All @@ -383,6 +383,8 @@ def _cpuinfo(self) -> list[AttrDict]:
for cpu in cpus
]
for entry in entries:
if "flags" not in entry:
break
entry.flags = set(entry.flags.split())
return entries

Expand Down

0 comments on commit 10b7bb6

Please sign in to comment.