diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index d097ec4536d..f6e34f041e3 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -66,8 +66,7 @@ class ApiClient(object): :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API. """ - def __init__(self, host=Configuration().host, - header_name=None, header_value=None, cookie=None): + def __init__(self, host=None, header_name=None, header_value=None, cookie=None): """ Constructor of the class. @@ -76,7 +75,10 @@ class ApiClient(object): self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value - self.host = host + if host is None: + self.host = Configuration().host + else: + self.host = host self.cookie = cookie # Set default User-Agent. self.user_agent = 'Python-Swagger/{{packageVersion}}'