Skip to content

Commit

Permalink
scripts: kconfig.py: Simplify write_kconfig_filenames()
Browse files Browse the repository at this point in the history
The assert has never hit and probably won't be useful. Shorten the code
a bit.

Signed-off-by: Ulf Magnusson <[email protected]>
  • Loading branch information
ulfalizer authored and carlescufi committed Jan 17, 2020
1 parent 7a531ea commit 7419f4f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions scripts/kconfig/kconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 7419f4f

Please sign in to comment.