scripts: kconfig.py: Simplify write_kconfig_filenames()

The assert has never hit and probably won't be useful. Shorten the code
a bit.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-11-16 05:12:00 +01:00 committed by Carles Cufí
commit 7419f4f46f

View file

@ -185,16 +185,10 @@ def write_kconfig_filenames(paths, root_path, output_file_path):
# to ensure that different representations of the same path does not end
# up with two entries, as that could cause the build system to fail.
paths_uniq = sorted({os.path.realpath(os.path.join(root_path, path))
for path in paths})
with open(output_file_path, 'w') as out:
for path in paths_uniq:
# Assert that the file exists, since it was sourced, it
# must surely also exist.
assert os.path.isfile(path), "Internal error: '{}' does not exist".format(path)
out.write("{}\n".format(path))
for path in sorted({os.path.realpath(os.path.join(root_path, path))
for path in paths}):
print(path, file=out)
def parse_args():