Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix platform_asic_checker script in order to run stretch Python 3.5.3 #9030

Merged
merged 1 commit into from
Oct 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/sonic-device-data/tests/platform_asic_checker
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ def main(argv):

# Load all the valid platforms as strings
platforms = set()
with os.scandir(args.platform_folder) as it:
it = os.scandir(args.platform_folder)
try:
for entry in it:
p = entry.path
if entry.is_dir() and os.path.isfile(os.path.join(p, 'rules.mk')):
platforms.add(entry.name)
finally:
# os.scandir().close() is only available in python 3.6 and later
if callable(getattr(it, "close", None)):
it.close()
# dnx platform is special broadcom platform, add it manually
platforms.add('broadcom-dnx')

Expand Down