diff --git a/python/ql/src/Classes/ShouldBeContextManager.ql b/python/ql/src/Classes/ShouldBeContextManager.ql index e6bf946b65a..fa7cebf9c77 100644 --- a/python/ql/src/Classes/ShouldBeContextManager.ql +++ b/python/ql/src/Classes/ShouldBeContextManager.ql @@ -14,8 +14,8 @@ import python -from ClassObject c -where not c.isC() and not c.isContextManager() and exists(c.declaredAttribute("__del__")) +from ClassValue c +where not c.isBuiltin() and not c.isContextManager() and exists(c.declaredAttribute("__del__")) select c, "Class " + c.getName() + " implements __del__ (presumably to release some resource). Consider making it a context manager." diff --git a/python/ql/src/analysis/RatioOfDefinitions.ql b/python/ql/src/analysis/RatioOfDefinitions.ql index 13bad7112b9..72a3fed0e69 100644 --- a/python/ql/src/analysis/RatioOfDefinitions.ql +++ b/python/ql/src/analysis/RatioOfDefinitions.ql @@ -7,7 +7,7 @@ import DefinitionTracking predicate want_to_have_definition(Expr e) { /* not builtin object like len, tuple, etc. */ - not exists(Object cobj | e.refersTo(cobj) and cobj.isC()) and + not exists(Value builtin | e.pointsTo(builtin) and builtin.isBuiltin()) and ( e instanceof Name and e.(Name).getCtx() instanceof Load or