mirror of
https://github.com/davidhalter/parso.git
synced 2026-10-01 15:33:46 +08:00
Retrieve all kinds of assignment targets from with test
This commit is contained in:
1 parent
6ae0efa415
commit
606c528803
2 files changed
+11
-2
No files matched your search
@@ -775,8 +775,8 @@ class WithStmt(Flow):
|
||||
return names
|
||||
|
||||
def get_test_node_from_name(self, name):
|
||||
node = name.parent
|
||||
if node.type != 'with_item':
|
||||
node = search_ancestor(name, "with_item")
|
||||
if node is None:
|
||||
raise ValueError('The name is not actually part of a with statement.')
|
||||
return node.children[0]
|
||||
|
||||
|
||||
Reference in new issue
Block a user