Browse Source

Trying to make the code clearer

master
Dimitri Merejkowsky 5 years ago
parent
commit
785a137547
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      sources/marvel/marvel.py

+ 2
- 3
sources/marvel/marvel.py View File

@@ -42,9 +42,8 @@ class Client:
def make_request(self, query): def make_request(self, query):
params = self.auth.generate_params() params = self.auth.generate_params()
params.update(query.params()) params.update(query.params())
url = Client.base_url + query.path()
url_query = urllib.parse.urlencode(params)
full_url = url + "?" + url_query
query_string = urllib.parse.urlencode(params)
full_url = Client.base_url + query.path() + "?" + query_string
with urllib.request.urlopen(full_url) as response: with urllib.request.urlopen(full_url) as response:
status_code = response.getcode() status_code = response.getcode()
if status_code != 200: if status_code != 200: