File tree Expand file tree Collapse file tree
python/ql/src/semmle/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,12 +209,14 @@ module API {
209209
210210 /**
211211 * Gets a node corresponding to an import of module `m`.
212- *
213- * Note: You should only use this predicate for top level modules. If you want nodes corresponding to a submodule,
214- * you should use `.getMember` on the parent module. For example, for nodes corresponding to the module `foo.bar`,
215- * use `moduleImport("foo").getMember("bar")`.
216212 */
217- Node moduleImport ( string m ) { result = Impl:: MkModuleImport ( m ) }
213+ Node moduleImport ( string m ) {
214+ result = Impl:: MkModuleImport ( m )
215+ or
216+ exists ( string before_dot , string after_dot | before_dot + "." + after_dot = m |
217+ result = moduleImport ( before_dot ) .getMember ( after_dot )
218+ )
219+ }
218220
219221 /**
220222 * Provides the actual implementation of API graphs, cached for performance.
You can’t perform that action at this time.
0 commit comments