make more python like

This commit is contained in:
Thomas S Hatch 2012-04-25 14:04:36 -06:00
parent 6ec527809e
commit a750d2359f

View File

@ -508,11 +508,8 @@ def contains(path, text):
try:
with open(path, 'r') as fp_:
while True:
data = fp_.readline()
if not data:
break
if text.strip() == data.strip():
for line in fp_:
if text.strip() == line.strip():
return True
return False
except (IOError, OSError):