mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Python: Handle __all__ assigned to a tuple
Examples where this is used in real code: -76c0b32f82/django/core/files/temp.py (L24)-76c0b32f82/django/contrib/gis/gdal/__init__.py (L44-L49)
This commit is contained in:
@@ -129,7 +129,11 @@ class Module extends Module_, Scope, AstNode {
|
||||
a.defines(all) and
|
||||
a.getScope() = this and
|
||||
all.getId() = "__all__" and
|
||||
a.getValue().(List).getAnElt().(StrConst).getText() = name
|
||||
(
|
||||
a.getValue().(List).getAnElt().(StrConst).getText() = name
|
||||
or
|
||||
a.getValue().(Tuple).getAnElt().(StrConst).getText() = name
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
| all_dynamic.py:0:0:0:0 | Module all_dynamic | foo |
|
||||
| all_list.py:0:0:0:0 | Module all_list | bar |
|
||||
| all_list.py:0:0:0:0 | Module all_list | foo |
|
||||
| all_tuple.py:0:0:0:0 | Module all_tuple | bar |
|
||||
| all_tuple.py:0:0:0:0 | Module all_tuple | foo |
|
||||
|
||||
Reference in New Issue
Block a user