Skip to content

Commit

Permalink
Refactor query kwargs handling more pythonic
Browse files Browse the repository at this point in the history
  • Loading branch information
JOJ0 committed Jan 24, 2025
1 parent 914fbf3 commit c0f633b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions synadm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ def query(self, method, urlpart, params=None, data=None, token=None,
logged and None is returned.
"""
args = [urllib.parse.quote(arg, safe="") for arg in args]
kwargs = dict(kwargs)
for i in kwargs.keys():
kwargs[i] = urllib.parse.quote(kwargs[i], safe="")
kwargs = {k: urllib.parse.quote(v, safe="") for k, v in kwargs.items()}
urlpart = urlpart.format(*args, **kwargs)

if base_url_override:
Expand Down

0 comments on commit c0f633b

Please sign in to comment.