In do_update_crates(), properly close the target_file after writing to
it using the "with" statement.
Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
crates += c
if crates is None:
raise ValueError("Unable to find any Cargo.lock in ${CARGO_LOCK_SRC_DIR}")
-open("${TARGET_FILE}", 'w').write(crates)
+with open("${TARGET_FILE}", 'w') as f:
+ f.write(crates)
EOF
bbnote "Successfully update crates inside '${TARGET_FILE}'"