Fix iterating over the 'cache' dictionary in refresh(). A dictionary is
not callable. This fixes the following error:
>> import procfs.sysctl
>> s = procfs.sysctl()
>> s.refresh()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/site-packages/procfs/sysctl.py", line 64, in refresh
for key in self.cache():
TypeError: 'dict' object is not callable
Signed-off-by: Ondřej Lysoněk <olysonek(a)redhat.com>
---
procfs/sysctl.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/procfs/sysctl.py b/procfs/sysctl.py
index 8b256ab..6a91455 100755
--- a/procfs/sysctl.py
+++ b/procfs/sysctl.py
@@ -61,7 +61,7 @@ class sysctl:
f.close()
def refresh(self):
- for key in self.cache():
+ for key in self.cache.keys():
del self.cache[key]
value = self.read(key)
if value != None:
--
2.17.2