Skip to content

Commit b0e7989

Browse files
committed
Python: Use new importNode
1 parent 4597ba6 commit b0e7989

File tree

1 file changed

+5
-4
lines changed
  • python/ql/src/experimental/semmle/python/frameworks

1 file changed

+5
-4
lines changed

python/ql/src/experimental/semmle/python/frameworks/Invoke.qll

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private module Invoke {
1818
/** Gets a reference to the `invoke` module. */
1919
private DataFlow::Node invoke(DataFlow::TypeTracker t) {
2020
t.start() and
21-
result = DataFlow::importModule("invoke")
21+
result = DataFlow::importNode("invoke")
2222
or
2323
exists(DataFlow::TypeTracker t2 | result = invoke(t2).track(t2, t))
2424
}
@@ -34,10 +34,10 @@ private module Invoke {
3434
attr_name in ["run", "sudo", "context", "Context", "task"] and
3535
(
3636
t.start() and
37-
result = DataFlow::importMember("invoke", attr_name)
37+
result = DataFlow::importNode("invoke." + attr_name)
3838
or
3939
t.startInAttr(attr_name) and
40-
result = DataFlow::importModule("invoke")
40+
result = DataFlow::importNode("invoke")
4141
)
4242
or
4343
// Due to bad performance when using normal setup with `invoke_attr(t2, attr_name).track(t2, t)`
@@ -77,11 +77,12 @@ private module Invoke {
7777
/** Gets a reference to the `invoke.context.Context` class. */
7878
private DataFlow::Node classRef(DataFlow::TypeTracker t) {
7979
t.start() and
80-
result = DataFlow::importMember("invoke.context", "Context")
80+
result = DataFlow::importNode("invoke.context.Context")
8181
or
8282
t.startInAttr("Context") and
8383
result = invoke::context()
8484
or
85+
// handle invoke.Context alias
8586
t.start() and
8687
result = invoke_attr("Context")
8788
or

0 commit comments

Comments
 (0)