From 762863aae00cf3d72ece43058a31be42c6f6eaeb Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 22 Oct 2019 15:26:08 -0700 Subject: [PATCH] Only decode the file content on Py2 --- demo/Main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo/Main.py b/demo/Main.py index e0b440b0..b7c4b36b 100644 --- a/demo/Main.py +++ b/demo/Main.py @@ -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