]> granicus.if.org Git - esp-idf/commitdiff
idf_ext.py: Fix Python 3 compatibility issue
authorRoland Dobai <dobai.roland@gmail.com>
Thu, 25 Oct 2018 09:02:58 +0000 (11:02 +0200)
committerRoland Dobai <dobai.roland@gmail.com>
Mon, 5 Nov 2018 07:11:02 +0000 (08:11 +0100)
tools/unit-test-app/idf_ext.py

index 13a01a311caec9a6555251af2161e9dc2a3b5b41..9bc9ae00738163d16245e07d2e6d6f7e463e57eb 100644 (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)
\ No newline at end of file
+    base_actions.update(extensions)