Skip to content

Commit d93bb78

Browse files
authored
[Core] Fix trio mypy errors (#33003)
The latest version of trio removed the `run_sync_in_worker_thread` method causing mypy to complain. This change adds a type ignore comment to places where this is called since it'll only hit that code path if an old enough version of trio is used. Signed-off-by: Paul Van Eck <[email protected]>
1 parent a631b94 commit d93bb78

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sdk/core/azure-core/azure/core/pipeline/transport/_requests_trio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ async def __anext__(self):
110110
self.iter_content_func,
111111
)
112112
except AttributeError: # trio < 0.12.1
113-
chunk = await trio.run_sync_in_worker_thread( # pylint: disable=no-member
113+
chunk = await trio.run_sync_in_worker_thread( # type: ignore # pylint: disable=no-member
114114
_iterate_response_content,
115115
self.iter_content_func,
116116
)
@@ -247,7 +247,7 @@ async def send(self, request, **kwargs: Any): # pylint:disable=invalid-overridd
247247
limiter=trio_limiter,
248248
)
249249
except AttributeError: # trio < 0.12.1
250-
response = await trio.run_sync_in_worker_thread( # pylint: disable=no-member
250+
response = await trio.run_sync_in_worker_thread( # type: ignore # pylint: disable=no-member
251251
functools.partial(
252252
self.session.request,
253253
request.method,

0 commit comments

Comments
 (0)