Skip to content

Commit 6686557

Browse files
committed
PYTHON-5623 - Loosen AsyncClientSession.with_transaction callback type
1 parent 5852bd8 commit 6686557

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/synchro.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,14 @@ def translate_coroutine_types(lines: list[str]) -> list[str]:
322322
index = lines.index(type)
323323
new = type.replace(old, res.group(3))
324324
lines[index] = new
325+
coroutine_types = [line for line in lines if "Awaitable[" in line]
326+
for type in coroutine_types:
327+
res = re.search(r"Awaitable\[([A-z]+)\]", type)
328+
if res:
329+
old = res[0]
330+
index = lines.index(type)
331+
new = type.replace(old, res.group(1))
332+
lines[index] = new
325333
return lines
326334

327335

0 commit comments

Comments
 (0)