idf_ext.py: Fix Python 3 compatibility issue

This commit is contained in:
Roland Dobai 2018-10-25 11:02:58 +02:00
parent 13046e7625
commit d4ba3bd2eb

View file

@ -141,12 +141,12 @@ def add_action_extensions(base_functions, base_actions):
# config folder to build config
sdkconfig_default = os.path.join(PROJECT_PATH, "sdkconfig.defaults")
with open(sdkconfig_default, "r") as sdkconfig_default_file:
with open(sdkconfig_default, "rb") as sdkconfig_default_file:
sdkconfig_temp.write(sdkconfig_default_file.read())
sdkconfig_config = os.path.join(PROJECT_PATH, "configs", config_name)
with open(sdkconfig_config, "r") as sdkconfig_config_file:
sdkconfig_temp.write("\n")
with open(sdkconfig_config, "rb") as sdkconfig_config_file:
sdkconfig_temp.write(b"\n")
sdkconfig_temp.write(sdkconfig_config_file.read())
sdkconfig_temp.flush()
@ -276,4 +276,4 @@ idf.py ut-apply-config-NAME - Generates configuration based on configs/NAME in s
extensions["ut-help"] = (ut_help, [], [])
base_actions.update(extensions)
base_actions.update(extensions)