Skip to content

Commit eaca7b8

Browse files
Arunwing328
authored andcommitted
[Python] Remove redundant else statement (#4311)
* [Python] Remove redundant else condition * Add indentation * Reduce extra indent * Avoid longer than 79 chars * Remove trailing space after response_body * [Python] Fix pep8 violation in imports * Revert "[Python] Fix pep8 violation in imports" This reverts commit bc69aaa.
1 parent b1984f3 commit eaca7b8

File tree

5 files changed

+65
-60
lines changed

5 files changed

+65
-60
lines changed

modules/openapi-generator/src/main/resources/python/api_client.mustache

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,18 +347,19 @@ class ApiClient(object):
347347
response_type, auth_settings,
348348
_return_http_data_only, collection_formats,
349349
_preload_content, _request_timeout, _host)
350-
else:
351-
thread = self.pool.apply_async(self.__call_api, (resource_path,
352-
method, path_params, query_params,
353-
header_params, body,
354-
post_params, files,
355-
response_type, auth_settings,
356-
_return_http_data_only,
357-
collection_formats,
358-
_preload_content,
359-
_request_timeout,
360-
_host))
361-
return thread
350+
351+
return self.pool.apply_async(self.__call_api, (resource_path,
352+
method, path_params,
353+
query_params,
354+
header_params, body,
355+
post_params, files,
356+
response_type,
357+
auth_settings,
358+
_return_http_data_only,
359+
collection_formats,
360+
_preload_content,
361+
_request_timeout,
362+
_host))
362363

363364
def request(self, method, url, query_params=None, headers=None,
364365
post_params=None, body=None, _preload_content=True,

samples/client/petstore/python-asyncio/petstore_api/api_client.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -340,18 +340,19 @@ def call_api(self, resource_path, method,
340340
response_type, auth_settings,
341341
_return_http_data_only, collection_formats,
342342
_preload_content, _request_timeout, _host)
343-
else:
344-
thread = self.pool.apply_async(self.__call_api, (resource_path,
345-
method, path_params, query_params,
346-
header_params, body,
347-
post_params, files,
348-
response_type, auth_settings,
349-
_return_http_data_only,
350-
collection_formats,
351-
_preload_content,
352-
_request_timeout,
353-
_host))
354-
return thread
343+
344+
return self.pool.apply_async(self.__call_api, (resource_path,
345+
method, path_params,
346+
query_params,
347+
header_params, body,
348+
post_params, files,
349+
response_type,
350+
auth_settings,
351+
_return_http_data_only,
352+
collection_formats,
353+
_preload_content,
354+
_request_timeout,
355+
_host))
355356

356357
def request(self, method, url, query_params=None, headers=None,
357358
post_params=None, body=None, _preload_content=True,

samples/client/petstore/python-tornado/petstore_api/api_client.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -342,18 +342,19 @@ def call_api(self, resource_path, method,
342342
response_type, auth_settings,
343343
_return_http_data_only, collection_formats,
344344
_preload_content, _request_timeout, _host)
345-
else:
346-
thread = self.pool.apply_async(self.__call_api, (resource_path,
347-
method, path_params, query_params,
348-
header_params, body,
349-
post_params, files,
350-
response_type, auth_settings,
351-
_return_http_data_only,
352-
collection_formats,
353-
_preload_content,
354-
_request_timeout,
355-
_host))
356-
return thread
345+
346+
return self.pool.apply_async(self.__call_api, (resource_path,
347+
method, path_params,
348+
query_params,
349+
header_params, body,
350+
post_params, files,
351+
response_type,
352+
auth_settings,
353+
_return_http_data_only,
354+
collection_formats,
355+
_preload_content,
356+
_request_timeout,
357+
_host))
357358

358359
def request(self, method, url, query_params=None, headers=None,
359360
post_params=None, body=None, _preload_content=True,

samples/client/petstore/python/petstore_api/api_client.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -340,18 +340,19 @@ def call_api(self, resource_path, method,
340340
response_type, auth_settings,
341341
_return_http_data_only, collection_formats,
342342
_preload_content, _request_timeout, _host)
343-
else:
344-
thread = self.pool.apply_async(self.__call_api, (resource_path,
345-
method, path_params, query_params,
346-
header_params, body,
347-
post_params, files,
348-
response_type, auth_settings,
349-
_return_http_data_only,
350-
collection_formats,
351-
_preload_content,
352-
_request_timeout,
353-
_host))
354-
return thread
343+
344+
return self.pool.apply_async(self.__call_api, (resource_path,
345+
method, path_params,
346+
query_params,
347+
header_params, body,
348+
post_params, files,
349+
response_type,
350+
auth_settings,
351+
_return_http_data_only,
352+
collection_formats,
353+
_preload_content,
354+
_request_timeout,
355+
_host))
355356

356357
def request(self, method, url, query_params=None, headers=None,
357358
post_params=None, body=None, _preload_content=True,

samples/openapi3/client/petstore/python/petstore_api/api_client.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -340,18 +340,19 @@ def call_api(self, resource_path, method,
340340
response_type, auth_settings,
341341
_return_http_data_only, collection_formats,
342342
_preload_content, _request_timeout, _host)
343-
else:
344-
thread = self.pool.apply_async(self.__call_api, (resource_path,
345-
method, path_params, query_params,
346-
header_params, body,
347-
post_params, files,
348-
response_type, auth_settings,
349-
_return_http_data_only,
350-
collection_formats,
351-
_preload_content,
352-
_request_timeout,
353-
_host))
354-
return thread
343+
344+
return self.pool.apply_async(self.__call_api, (resource_path,
345+
method, path_params,
346+
query_params,
347+
header_params, body,
348+
post_params, files,
349+
response_type,
350+
auth_settings,
351+
_return_http_data_only,
352+
collection_formats,
353+
_preload_content,
354+
_request_timeout,
355+
_host))
355356

356357
def request(self, method, url, query_params=None, headers=None,
357358
post_params=None, body=None, _preload_content=True,

0 commit comments

Comments
 (0)