simplify (for line in f.readlines() -> for line in f)
This commit is contained in:
parent
6eade15b4e
commit
1549e7eb18
|
@ -35,7 +35,7 @@ class Blacklist(object):
|
|||
if self.last_mtime is None or current_mtime > self.last_mtime:
|
||||
self.entries.clear()
|
||||
with open(self.blacklist_fn, "r") as f:
|
||||
for line in f.readlines():
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if not line or line.startswith("#"):
|
||||
continue
|
||||
|
|
|
@ -20,7 +20,7 @@ def get_memory_usage():
|
|||
stats = {}
|
||||
try:
|
||||
with open("/proc/self/status", "r") as f:
|
||||
for line in f.readlines():
|
||||
for line in f:
|
||||
name, right = line.split(":",2)
|
||||
if name in stat_names:
|
||||
assert right.endswith(" kB\n")
|
||||
|
|
|
@ -32,7 +32,7 @@ class AccountFileChecker(object):
|
|||
self.pubkeys = {}
|
||||
self.rootcaps = {}
|
||||
with open(abspath_expanduser_unicode(accountfile), "r") as f:
|
||||
for line in f.readlines():
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if line.startswith("#") or not line:
|
||||
continue
|
||||
|
|
|
@ -139,7 +139,7 @@ def get_aliases(nodedir):
|
|||
pass
|
||||
try:
|
||||
with codecs.open(aliasfile, "r", "utf-8") as f:
|
||||
for line in f.readlines():
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
if line.startswith("#") or not line:
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue