Only decode the file content on Py2

This commit is contained in:
Robin Dunn
2019-10-22 15:26:08 -07:00
parent edaf5c96d7
commit 762863aae0

View File

@@ -968,7 +968,8 @@ def SearchDemo(name, keyword):
fullText = fid.read()
fid.close()
fullText = fullText.decode("iso-8859-1")
if six.PY2:
fullText = fullText.decode("iso-8859-1")
if fullText.find(keyword) >= 0:
return True