Skip to content

Commit f73876e

Browse files
committed
Python: Modernise ShouldBeContextManager
1 parent 37cfb54 commit f73876e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/ql/src/Classes/ShouldBeContextManager.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
import python
1616

17-
from ClassObject c
18-
where not c.isC() and not c.isContextManager() and exists(c.declaredAttribute("__del__"))
17+
from ClassValue c
18+
where not c.isBuiltin() and not c.isContextManager() and exists(c.declaredAttribute("__del__"))
1919
select c,
2020
"Class " + c.getName() +
2121
" implements __del__ (presumably to release some resource). Consider making it a context manager."

0 commit comments

Comments
 (0)