Skip to content

Commit d804acd

Browse files
yofftausbn
andauthored
Apply suggestions from code review
Co-authored-by: Taus <[email protected]>
1 parent 9119852 commit d804acd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/ql/src/Expressions/CallToSuperWrongClass.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import semmle.python.dataflow.new.DataFlow
1717

1818
from DataFlow::CallCfgNode call_to_super, string name
1919
where
20-
call_to_super.getFunction().getALocalSource().asExpr().(Name).getId() = "super" and
20+
call_to_super = API::builtin("super").getACall() and
2121
name = call_to_super.getScope().getScope().(Class).getName() and
2222
exists(DataFlow::Node arg |
2323
arg = call_to_super.getArg(0) and
24-
not arg.getALocalSource().asExpr().(Name).getId() = name
24+
arg.getALocalSource().asExpr().(Name).getId() != name
2525
)
2626
select call_to_super.getNode(), "First argument to super() should be " + name + "."

0 commit comments

Comments
 (0)