Fix get_context indentation for async functions (#2107)

This commit is contained in:
曾楚笑 authored and GitHub committed 2026-09-22 21:50:04 +00:00
1 parent 19236b472b
commit 5c37b736a3
3 files changed
+33

No files matched your search

+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()