create directory before writing into the file.
The with open() method creates the file if it does not exist, but gives a FileNotFound error if the path does not exist. Hence, creating the path directories before using the file. Bug: N/A Test: the build passes. Change-Id: Id5b285ea5581f7ef526876fb6e13a3bf69098acd
This commit is contained in:
@@ -1307,6 +1307,7 @@ class SdkDistProducer:
|
||||
|
||||
def dist_generate_sdk_supported_modules_file(self, modules):
|
||||
sdk_modules_file = os.path.join(self.dist_dir, "sdk-modules.txt")
|
||||
os.makedirs(os.path.dirname(sdk_modules_file), exist_ok=True)
|
||||
with open(sdk_modules_file, "w", encoding="utf8") as file:
|
||||
for module in modules:
|
||||
if module in MAINLINE_MODULES:
|
||||
|
||||
Reference in New Issue
Block a user