- Add missing "open" to with statement.
- Fix tests in __main__
Signed-off-by: John Kacur <jkacur(a)redhat.com>
---
procfs/procfs.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/procfs/procfs.py b/procfs/procfs.py
index de55dfc1aef4..6e68ed132ddd 100755
--- a/procfs/procfs.py
+++ b/procfs/procfs.py
@@ -973,7 +973,7 @@ class smaps:
def reload(self):
line = None
- with("/proc/%d/smaps" % self.pid) as f:
+ with open("/proc/%d/smaps" % self.pid) as f:
while True:
line = self.parse_entry(f, line)
if not line:
@@ -1121,5 +1121,5 @@ if __name__ == '__main__':
time.sleep(1)
cs.reload()
for cpu in cs:
- print("%s: %d" % (cpu.name, cpu.usage))
+ print(f"{cpu}: {cs[cpu]}")
print("-" * 10)
--
2.37.2