diff --git a/sonic_y_cable/y_cable.py b/sonic_y_cable/y_cable.py index 809239d15ca2..95b11a59925f 100644 --- a/sonic_y_cable/y_cable.py +++ b/sonic_y_cable/y_cable.py @@ -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 accommodated for values # of MUX register specs of upper page 0x04 starting at 640