mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-25 01:37:22 +00:00
docs: Make the Python scripts Python 2&3 compatible
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from io import open
|
||||
import re
|
||||
import os
|
||||
import shutil
|
||||
@@ -25,10 +27,10 @@ def files_equal(path_1, path_2):
|
||||
if not os.path.exists(path_1) or not os.path.exists(path_2):
|
||||
return False
|
||||
file_1_contents = ''
|
||||
with open(path_1, "r") as f_1:
|
||||
with open(path_1, "r", encoding='utf-8') as f_1:
|
||||
file_1_contents = f_1.read()
|
||||
file_2_contents = ''
|
||||
with open(path_2, "r") as f_2:
|
||||
with open(path_2, "r", encoding='utf-8') as f_2:
|
||||
file_2_contents = f_2.read()
|
||||
return file_1_contents == file_2_contents
|
||||
|
||||
|
Reference in New Issue
Block a user