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

[y_cable] Skip ImportError in y_cable.py #154

Merged
merged 2 commits into from
Dec 15, 2020
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
12 changes: 8 additions & 4 deletions sonic_y_cable/y_cable.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@

try:
import struct

import sonic_platform.platform
from sonic_py_common import logger

import sonic_platform.platform
except ImportError as e:
raise ImportError(str(e) + " - required module not found")
# When build python3 xcvrd, it tries to do basic check which will import this file. However,
# not all platform supports python3 API now, so it could cause an issue when importing
# sonic_platform.platform. We skip the ImportError here. This is safe because:
# 1. If any python package is not available, there will be exception when use it
# 2. Vendors know their platform API version, they are responsible to use correct python
# version when importing this file.
pass

# definitions of the offset with width accomodated for values
# of MUX register specs of upper page 0x04 starting at 640
Expand Down