Python: Workaround for module level items from import * not being LocalSourceNodes

This commit is contained in:
Rasmus Wriedt Larsen
2023-10-10 15:52:01 +02:00
parent 6521e5165c
commit 72d0dcdaba
2 changed files with 21 additions and 4 deletions

View File

@@ -2,11 +2,11 @@
from unknown import * #$ use=moduleImport("unknown")
# Currently missing, as we do not consider `hello` to be a `LocalSourceNode`, since it has flow
# going into it from its corresponding `GlobalSsaVariable`.
hello() #$ MISSING: use=moduleImport("unknown").getMember("hello").getReturn()
# This used to be missing, as we did not consider `hello` to be a `LocalSourceNode`,
# since it has flow going into it from its corresponding `GlobalSsaVariable`.
hello() #$ use=moduleImport("unknown").getMember("hello").getReturn()
print(const_from_unknown) #$ MISSING: use=moduleImport("unknown").getMember("const_from_unknown")
print(const_from_unknown) #$ use=moduleImport("unknown").getMember("const_from_unknown")
# We don't want our analysis to think that either `non_module_member` or `outer_bar` can
# come from `from unknown import *`