Skip to content

Commit df6039d

Browse files
committed
Python: Add import resolution regression
1 parent e1ae3c3 commit df6039d

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

python/ql/test/experimental/import-resolution/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ def local_import():
8484
check("clashing_attr", clashing_attr, "clashing_attr", globals()) #$ prints=clashing_attr SPURIOUS: prints="<module attr_clash.clashing_attr>"
8585
check("non_clashing_submodule", non_clashing_submodule, "<module attr_clash.non_clashing_submodule>", globals()) #$ prints="<module attr_clash.non_clashing_submodule>"
8686

87+
88+
# check that import * from an __init__ file works
89+
from package.subpackage2 import *
90+
check("subpackage2_attr", subpackage2_attr, "subpackage2_attr", globals()) #$ MISSING: prints=subpackage2_attr
91+
92+
8793
exit(__file__)
8894

8995
print()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from trace import *
2+
enter(__file__)
3+
4+
subpackage2_attr = "subpackage2_attr"
5+
6+
exit(__file__)

0 commit comments

Comments
 (0)