Skip to content

Commit

Permalink
Refactor query args handling more pythonic
Browse files Browse the repository at this point in the history
  • Loading branch information
JOJ0 committed Jan 24, 2025

Verified

This commit was signed with the committer’s verified signature.
bitoku Ayato Tokubi
1 parent b3576b5 commit 914fbf3
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
@@ -117,10 +117,8 @@ def query(self, method, urlpart, params=None, data=None, token=None,
JSON strings. On exceptions the error type and description are
logged and None is returned.
"""
args = list(args)
args = [urllib.parse.quote(arg, safe="") for arg in args]
kwargs = dict(kwargs)
for i in range(len(args)):
args[i] = urllib.parse.quote(args[i], safe="")
for i in kwargs.keys():
kwargs[i] = urllib.parse.quote(kwargs[i], safe="")
urlpart = urlpart.format(*args, **kwargs)

0 comments on commit 914fbf3

Please sign in to comment.