Fix get_context indentation for async functions (#2107)

This commit is contained in:
曾楚笑
2026-09-22 21:50:04 +00:00
committed by GitHub
parent 19236b472b
commit 5c37b736a3
3 changed files with 33 additions and 0 deletions
+2
View File
@@ -502,6 +502,8 @@ class Script:
tree_name = name.tree_name
if tree_name is not None: # Happens with lambdas.
scope = tree_name.get_definition()
if scope.parent.type in ('async_stmt', 'async_funcdef'):
scope = scope.parent
if scope.start_pos[1] < column:
break
definition = definition.parent()