Skip to content

Commit 4c66071

Browse files
committed
Python: Revert "Python: Support moduleImport("dotted.name") in API graphs"
This reverts commit 2c4a477. It's probably best _not_ to do this, as any `getMember` cycle in the API graph will lead to nontermination.
1 parent ea30598 commit 4c66071

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

python/ql/src/semmle/python/ApiGraphs.qll

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -209,14 +209,12 @@ 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")`.
212216
*/
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-
}
217+
Node moduleImport(string m) { result = Impl::MkModuleImport(m) }
220218

221219
/**
222220
* Provides the actual implementation of API graphs, cached for performance.

0 commit comments

Comments
 (0)