Skip to content
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.

Commit

Permalink
Update calls to static method for tie_breaker (#566)
Browse files Browse the repository at this point in the history
I'm adding this because after using your great playlist importer in conjunction with gmusicapi, I was getting exceptions when using it for certain queries.
- TypeError: 'staticmethod' object is not callable

I'm no python expert but after some StackOverflow'ing, this seems somewhat acceptable. (https://stackoverflow.com/a/12718272). Apparently also added to https://docs.python.org/2/whatsnew/2.7.html#other-language-changes
  • Loading branch information
adhamu authored and simon-weber committed Aug 6, 2017
1 parent bdc8617 commit 74721cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gmusicapi/gmtools/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ def query_library(self, query, tie_breaker=no_tiebreak, modifiers=None, auto=Fal
try:
current_mods.append(next(future_mods))
except StopIteration:
raise self.TieBroken(tie_breaker(query, results))
raise self.TieBroken(tie_breaker.__func__(query, results))

next_results = self.query_library(query, tie_breaker, current_mods, auto)

if not next_results:
raise self.TieBroken(tie_breaker(query, results))
raise self.TieBroken(tie_breaker.__func__(query, results))
else:
return next_results
except self.TieBroken as tie:
Expand Down

0 comments on commit 74721cb

Please sign in to comment.