mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
Python: Add import resolution regression
This commit is contained in:
@@ -84,6 +84,12 @@ from attr_clash import clashing_attr, non_clashing_submodule #$ imports=attr_cla
|
||||
check("clashing_attr", clashing_attr, "clashing_attr", globals()) #$ prints=clashing_attr SPURIOUS: prints="<module attr_clash.clashing_attr>"
|
||||
check("non_clashing_submodule", non_clashing_submodule, "<module attr_clash.non_clashing_submodule>", globals()) #$ prints="<module attr_clash.non_clashing_submodule>"
|
||||
|
||||
|
||||
# check that import * from an __init__ file works
|
||||
from package.subpackage2 import *
|
||||
check("subpackage2_attr", subpackage2_attr, "subpackage2_attr", globals()) #$ MISSING: prints=subpackage2_attr
|
||||
|
||||
|
||||
exit(__file__)
|
||||
|
||||
print()
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
from trace import *
|
||||
enter(__file__)
|
||||
|
||||
subpackage2_attr = "subpackage2_attr"
|
||||
|
||||
exit(__file__)
|
||||
Reference in New Issue
Block a user