forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request github#10861 from tausbn/python-clean-up-import-re…
…solution Python: Clean up import resolution
- Loading branch information
Showing
18 changed files
with
666 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
python/ql/test/experimental/import-resolution/attr_clash/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from trace import * | ||
enter(__file__) | ||
|
||
clashing_attr = "clashing_attr" | ||
|
||
exit(__file__) |
4 changes: 4 additions & 0 deletions
4
python/ql/test/experimental/import-resolution/attr_clash/clashing_attr.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from trace import * | ||
enter(__file__) | ||
|
||
exit(__file__) |
4 changes: 4 additions & 0 deletions
4
python/ql/test/experimental/import-resolution/attr_clash/non_clashing_submodule.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from trace import * | ||
enter(__file__) | ||
|
||
exit(__file__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from trace import * | ||
enter(__file__) | ||
|
||
bar_attr = "bar_attr" | ||
|
||
exit(__file__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from trace import * | ||
enter(__file__) | ||
|
||
# A simple attribute. Used in main.py | ||
foo_attr = "foo_attr" | ||
|
||
# A private attribute. Accessible from main.py despite this. | ||
__private_foo_attr = "__private_foo_attr" | ||
|
||
# A reexport of bar under a new name. Used in main.py | ||
import bar as bar_reexported #$ imports=bar as=bar_reexported | ||
check("bar_reexported.bar_attr", bar_reexported.bar_attr, "bar_attr", globals()) #$ prints=bar_attr | ||
|
||
exit(__file__) |
Empty file.
Oops, something went wrong.