mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Python: Port SlotsInOldStyleClass.ql
Only trivial test changes.
This commit is contained in:
@@ -12,9 +12,11 @@
|
||||
*/
|
||||
|
||||
import python
|
||||
private import LegacyPointsTo
|
||||
private import semmle.python.dataflow.new.internal.DataFlowDispatch
|
||||
|
||||
from ClassObject c
|
||||
where not c.isNewStyle() and c.declaresAttribute("__slots__") and not c.failedInference()
|
||||
from Class c
|
||||
where
|
||||
not DuckTyping::isNewStyle(c) and
|
||||
DuckTyping::declaresAttribute(c, "__slots__")
|
||||
select c,
|
||||
"Using '__slots__' in an old style class just creates a class attribute called '__slots__'."
|
||||
|
||||
@@ -1 +1 @@
|
||||
| newstyle_test.py:4:1:4:16 | class OldStyle1 | Using '__slots__' in an old style class just creates a class attribute called '__slots__'. |
|
||||
| newstyle_test.py:4:1:4:16 | Class OldStyle1 | Using '__slots__' in an old style class just creates a class attribute called '__slots__'. |
|
||||
|
||||
Reference in New Issue
Block a user