moovio_sdk 0.9.0__py3-none-any.whl → 0.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
moovio_sdk/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "moovio_sdk"
6
- __version__: str = "0.9.0"
6
+ __version__: str = "0.10.0"
7
7
  __openapi_doc_version__: str = "latest"
8
- __gen_version__: str = "2.599.0"
9
- __user_agent__: str = "speakeasy-sdk/python 0.9.0 2.599.0 latest moovio_sdk"
8
+ __gen_version__: str = "2.610.0"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.10.0 2.610.0 latest moovio_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
moovio_sdk/httpclient.py CHANGED
@@ -115,42 +115,12 @@ def close_clients(
115
115
  pass
116
116
 
117
117
  if async_client is not None and not async_client_supplied:
118
- # First, try the simplest approach - use asyncio.run()
119
- # This works when we're not in an async context
120
118
  try:
121
- asyncio.run(async_client.aclose())
122
- except RuntimeError as e:
123
- # If we get "RuntimeError: This event loop is already running",
124
- # it means we're in an async context
125
- if "already running" in str(e):
126
- try:
127
- # We're in an async context, so get the running loop
128
- loop = asyncio.get_running_loop()
129
- # Create a task but don't wait for it
130
- loop.create_task(async_client.aclose())
131
- except Exception:
132
- # If we can't get the loop or create a task, just ignore
133
- # The GC will eventually clean up the resources
134
- pass
135
- # If we get "RuntimeError: There is no current event loop in thread",
136
- # we're not in an async context, but asyncio.run() failed for some reason
137
- # In this case, we can try to create a new event loop explicitly
138
- elif "no current event loop" in str(e):
139
- try:
140
- # Create a new event loop and run the coroutine
141
- loop = asyncio.new_event_loop()
142
- asyncio.set_event_loop(loop)
143
- try:
144
- loop.run_until_complete(async_client.aclose())
145
- finally:
146
- loop.close()
147
- asyncio.set_event_loop(None)
148
- except Exception:
149
- # If this also fails, just ignore
150
- pass
151
- # For any other RuntimeError, just ignore
152
- else:
119
+ loop = asyncio.get_running_loop()
120
+ asyncio.run_coroutine_threadsafe(async_client.aclose(), loop)
121
+ except RuntimeError:
122
+ try:
123
+ asyncio.run(async_client.aclose())
124
+ except RuntimeError:
125
+ # best effort
153
126
  pass
154
- except Exception:
155
- # For any other exception, just ignore
156
- pass
@@ -1,4 +1,3 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
3
  # package
4
-