versionutils.is_compatible calling unnecessary tuple conversion
Bug #1641932 reported by
chenyujie
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo.utils |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Code abstract as following:
def is_compatible(
...
if same_major and (requested_parts[0] != current_parts[0]):
return False
return current_parts >= requested_parts
...
'requested_parts' can be compared with 'current_parts' without using tuple reference, such as:
if same_major and (requested_parts != current_parts):
return False
Otherwise it would cause a warning from 'pkg_resources'.
To post a comment you must log in.
This is duplicated with https:/ /bugs.launchpad .net/oslo. utils/+ bug/1706394 and fixed