Skip to content

Commit

Permalink
[rospack.py] Errored pkg name (#133 (comment)). 'None' causes TypeErr…
Browse files Browse the repository at this point in the history
…or ('<' not supported between instances of 'NoneType' and 'License) so defining non None.
  • Loading branch information
130s committed Dec 1, 2020
1 parent ca2a399 commit 32eb47d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rospkg/rospack.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ def get_licenses(self, pkg_name, implicit=True):
@rtype { k, [d] }
@raise ResourceNotFound
"""
MSG_LICENSE_NOTFOUND_SYSPKG = "ERR"
license_dict = defaultdict(list)
LICENSE_DEFINED = "license_not_found"

self.get_depends(name=pkg_name, implicit=implicit)

Expand All @@ -414,12 +414,12 @@ def get_licenses(self, pkg_name, implicit=True):
# Traverse for Non-ROS, system packages
pkgnames_rosdep = self.get_rosdeps(package=pkg_name, implicit=implicit)
for pkgname_rosdep in pkgnames_rosdep:
license_dict[MSG_LICENSE_NOTFOUND_SYSPKG].append(pkgname_rosdep)
license_dict[LICENSE_DEFINED].append(pkgname_rosdep)

# Sort pkg names in each license
# Sort pkg names within the set of pkgs with each license
for list_key in license_dict.values():
list_key.sort()
# Sort license names
# Sort licenspe names
licenses = OrderedDict(sorted(license_dict.items()))
return licenses

Expand Down

0 comments on commit 32eb47d

Please sign in to comment.