Skip to content

[Backport] [202205] Fix issue: should always check return value of a function if the function may return None#356

Merged
yxieca merged 2 commits intosonic-net:202205from
Junchao-Mellanox:backport-pr-350-202205
Apr 17, 2023
Merged

[Backport] [202205] Fix issue: should always check return value of a function if the function may return None#356
yxieca merged 2 commits intosonic-net:202205from
Junchao-Mellanox:backport-pr-350-202205

Conversation

@Junchao-Mellanox
Copy link
Contributor

@Junchao-Mellanox Junchao-Mellanox commented Mar 31, 2023

Backport #350 to 202205

Description

When a function may return None, caller should always check the return value before using it. This PR is to fix such issues in sonic-xcvr.

Motivation and Context

When a function may return None, caller should always check the return value before using it. This PR is to fix such issues in sonic-xcvr.

How Has This Been Tested?

Created unit test cases to avoid such thing happening

Additional Information (Optional)

…tion may return None (sonic-net#350)

Fix unit test failure
Conflicts:
	tests/sonic_xcvr/test_sff8436.py
	tests/sonic_xcvr/test_sff8636.py
@Junchao-Mellanox Junchao-Mellanox changed the base branch from master to 202205 March 31, 2023 09:53
@Junchao-Mellanox Junchao-Mellanox changed the title Fix issue: should always check return value of a function if the function may return None (#350) Fix unit test failure Conflicts: tests/sonic_xcvr/test_sff8436.py tests/sonic_xcvr/test_sff8636.py [Backport] [202205] Fix issue: should always check return value of a function if the function may return None Mar 31, 2023
@liat-grozovik
Copy link
Collaborator

@yxieca please help to merge

@yxieca yxieca merged commit 24009de into sonic-net:202205 Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants