Skip to content

Commit 058d2ff

Browse files
committed
Eliminate functions with mixed return strategies
1 parent b628831 commit 058d2ff

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

addonmanager_metadata.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def get_first_supported_freecad_version(metadata: Metadata) -> Optional[Version]
221221
"""Look through all content items of this metadata element and determine what the
222222
first version of freecad that ANY of the items support is. For example, if it
223223
contains several workbenches, some of which require v0.20, and some 0.21, then
224-
0.20 is returned. Returns None if frecadmin is unset by any part of this object."""
224+
0.20 is returned. Returns None if freecadmin is unset by any part of this object."""
225225

226226
current_earliest = metadata.freecadmin if metadata.freecadmin is not None else None
227227
for content_class in metadata.content.values():
@@ -247,6 +247,7 @@ def get_repo_url_from_metadata(metadata: Metadata) -> str:
247247
for url in metadata.url:
248248
if url.type == UrlType.repository:
249249
return url.location
250+
return ""
250251

251252

252253
class MetadataReader:

package_list.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ def data(self, index: QtCore.QModelIndex, role: int = QtCore.Qt.DisplayRole):
230230
if role == SortOptions.Score:
231231
return self.repos[row].score
232232

233+
# Anything else:
234+
return None
235+
233236
def headerData(self, _unused1, _unused2, _role=QtCore.Qt.DisplayRole):
234237
"""No header in this implementation: always returns None."""
235238
return None

0 commit comments

Comments
 (0)