File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
python/ql/lib/semmle/python/dataflow/new/internal Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -86,14 +86,18 @@ module ImportResolution {
86
86
predicate module_export ( Module m , string name , DataFlow:: CfgNode defn ) {
87
87
exists ( EssaVariable v , EssaDefinition essaDef |
88
88
v .getName ( ) = name and
89
- v .getAUse ( ) = ImportStar :: getStarImported * ( m ) .getANormalExit ( ) and
89
+ v .getAUse ( ) = m .getANormalExit ( ) and
90
90
allowedEssaImportStep * ( essaDef , v .getDefinition ( ) )
91
91
|
92
92
defn .getNode ( ) = essaDef .( AssignmentDefinition ) .getValue ( )
93
93
or
94
94
defn .getNode ( ) = essaDef .( ArgumentRefinement ) .getArgument ( )
95
95
)
96
96
or
97
+ // `from <pkg> import *`
98
+ module_export ( ImportStar:: getStarImported + ( m ) , name , defn )
99
+ or
100
+ // `import <pkg>` or `from <pkg> import <stuff>`
97
101
exists ( Alias a |
98
102
defn .asExpr ( ) = a .getValue ( ) and
99
103
a .getAsname ( ) .( Name ) .getId ( ) = name and
You can’t perform that action at this time.
0 commit comments