Avoid the need to import search_ancestor

This commit is contained in:
Dave Halter
2026-01-19 20:30:03 +01:00
parent 4a7b5f4879
commit 3ac1632a5c
13 changed files with 28 additions and 44 deletions
+1 -2
View File
@@ -15,7 +15,6 @@ Unfortunately every other thing is being ignored (e.g. a == '' would be easy to
check for -> a is a string). There's big potential in these checks.
"""
from parso.tree import search_ancestor
from parso.python.tree import Name
from jedi import settings
@@ -76,7 +75,7 @@ def check_flow_information(value, flow, search_name, pos):
])
for name in names:
ass = search_ancestor(name, 'assert_stmt')
ass = name.search_ancestor('assert_stmt')
if ass is not None:
result = _check_isinstance_type(value, ass.assertion, search_name)
if result is not None: