Skip to content

Commit

Permalink
Add an early exit to Client.search
Browse files Browse the repository at this point in the history
if anything else than tuple is passed.
  • Loading branch information
JOJ0 committed May 3, 2022
1 parent cbecf49 commit f2143fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions discogs_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ def search(self, *query, **fields):
(Artists, Releases, Masters, and Labels). The keyword arguments to this
function are serialized into the request's query string.
"""
if type(query) is not tuple:
raise TypeError("{} method is expecting tuple, {} found.".format(
__name__, type(query)
))

if query:
if type(query) == bytes:
fields['q'] = b' '.join(query)
Expand Down

0 comments on commit f2143fb

Please sign in to comment.