forked from loafle/openapi-generator-original
[python] Add back __enter__
and __exit__
methods for non asyncio (#16979)
This commit is contained in:
parent
c4b18f206d
commit
61629ae8ed
@ -92,6 +92,13 @@ class ApiClient:
|
||||
async def close(self):
|
||||
await self.rest_client.close()
|
||||
{{/asyncio}}
|
||||
{{^asyncio}}
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
pass
|
||||
{{/asyncio}}
|
||||
|
||||
@property
|
||||
def user_agent(self):
|
||||
|
@ -90,6 +90,11 @@ class ApiClient:
|
||||
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
|
||||
self.client_side_validation = configuration.client_side_validation
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
pass
|
||||
|
||||
@property
|
||||
def user_agent(self):
|
||||
|
@ -90,6 +90,11 @@ class ApiClient:
|
||||
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
|
||||
self.client_side_validation = configuration.client_side_validation
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
pass
|
||||
|
||||
@property
|
||||
def user_agent(self):
|
||||
|
@ -89,6 +89,11 @@ class ApiClient:
|
||||
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
|
||||
self.client_side_validation = configuration.client_side_validation
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
pass
|
||||
|
||||
@property
|
||||
def user_agent(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user