Skip to content

Commit

Permalink
fixed "TypeError: < not supported between instances of str and int" i…
Browse files Browse the repository at this point in the history
…f version is string
  • Loading branch information
Steve Kueng committed Oct 18, 2023
1 parent 2b26ba0 commit 87b6baf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/pkgsinfo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ class Pkginfo(Plist):
def data(cls):
'''Returns a structure with itemnames, versions, and filepaths'''
def cmp(a, b):
return (a > b) - (a < b)
try:
return (a > b) - (a < b)
except TypeError:
return 1

def compare_versions(a, b):
"""Internal comparison function for use in sorting"""
return cmp(LooseVersion(b[0]), LooseVersion(a[0]))
Expand Down

0 comments on commit 87b6baf

Please sign in to comment.