Skip to content

Commit c7c3ad2

Browse files
committed
Python: sync with Python
1 parent 2cbba65 commit c7c3ad2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModels.qll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,15 +427,14 @@ pragma[nomagic]
427427
private API::Node getNodeFromType(string package, string type) {
428428
exists(string package2, string type2, AccessPath path2 |
429429
typeModel(package, type, package2, type2, path2) and
430-
result = getNodeFromPath(package2, type2, path2, path2.getNumToken())
430+
result = getNodeFromPath(package2, type2, path2)
431431
)
432432
or
433433
result = any(TypeModelUseEntry e).getNodeForType(package, type)
434434
or
435435
result = any(TypeModelDefEntry e).getNodeForType(package, type)
436436
or
437-
isRelevantFullPath(package, type, _) and
438-
result = Specific::getExtraNodeFromPath(package, type, _, 0)
437+
result = Specific::getExtraNodeFromType(package, type)
439438
}
440439

441440
/**

python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModelsSpecific.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ predicate isPackageUsed(string package) { exists(API::moduleImport(package)) }
4040

4141
/** Gets a Python-specific interpretation of the `(package, type, path)` tuple after resolving the first `n` access path tokens. */
4242
bindingset[package, type, path]
43-
API::Node getExtraNodeFromPath(string package, string type, AccessPath path, int n) {
43+
API::Node getExtraNodeFromPath(string package, string type, AccessPath path, int n) { none() }
44+
45+
/** Gets a Python-specific interpretation of the `(package, type)` tuple. */
46+
API::Node getExtraNodeFromType(string package, string type) {
4447
type = "" and
45-
n = 0 and
46-
result = API::moduleImport(package) and
47-
exists(path)
48+
result = API::moduleImport(package)
4849
}
4950

5051
/**

0 commit comments

Comments
 (0)