joiner order fixes

This commit is contained in:
Erik Krogh Kristensen
2021-12-10 21:31:03 +01:00
parent 88e896992e
commit 35c7fa58a7
2 changed files with 4 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
import python
private import semmle.python.types.Builtins
private import semmle.python.internal.CachedStages
/**
* An alias in an import statement, the `mod as name` part of `import mod as name`. May be artificial;
@@ -203,7 +204,9 @@ class Import extends Import_ {
/** An import * statement */
class ImportStar extends ImportStar_ {
/* syntax: from modname import * */
cached
ImportExpr getModuleExpr() {
Stages::AST::ref() and
result = this.getModule()
or
result = this.getModule().(ImportMember).getModule()

View File

@@ -263,6 +263,7 @@ module Value {
* object of that name.
* For example `Value::named("len")` is the `Value` representing the `len` built-in function.
*/
pragma[nomagic]
Value named(string name) {
exists(string modname, string attrname | name = modname + "." + attrname |
result = Module::named(modname).attr(attrname)