Skip to content

Commit 5c79ad2

Browse files
tausbnRasmusWL
andauthored
Python: Apply suggestions from code review
Co-authored-by: Rasmus Wriedt Larsen <[email protected]>
1 parent 7ed0990 commit 5c79ad2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ private module Invoke {
3030
module Context {
3131
/** Gets a reference to the `invoke.context.Context` class. */
3232
API::Node classRef() {
33-
result =
34-
[API::moduleImport("invoke").getMember("context"), API::moduleImport("invoke")]
35-
.getMember("Context")
33+
result = API::moduleImport("invoke").getMember("context").getMember("Context")
34+
or
35+
result = API::moduleImport("invoke").getMember("Context")
3636
}
3737

3838
/** Gets a reference to an instance of `invoke.context.Context`. */
@@ -51,7 +51,7 @@ private module Invoke {
5151
}
5252

5353
/** Gets a reference to an instance of `invoke.context.Context`. */
54-
DataFlow::LocalSourceNode instance() { result = instance(DataFlow::TypeTracker::end()) }
54+
DataFlow::Node instance() { instance(DataFlow::TypeTracker::end()).flowsTo(result) }
5555

5656
/** Gets a reference to the `run` or `sudo` methods on a `invoke.context.Context` instance. */
5757
private DataFlow::LocalSourceNode instanceRunMethods(DataFlow::TypeTracker t) {

0 commit comments

Comments
 (0)