Python: Fix Python 2 tests

This commit is contained in:
Taus
2025-10-30 23:07:25 +00:00
parent 5b63b4957c
commit 85029bd77d
25 changed files with 25 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ModuleObject m from ModuleObject m
/* Exclude the builtins module as it has a different name under 2 and 3. */ /* Exclude the builtins module as it has a different name under 2 and 3. */

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
where exists(theSysModuleObject()) where exists(theSysModuleObject())
select 1 select 1

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ExceptFlowNode ex, Value val from ExceptFlowNode ex, Value val
where ex.handledException(val, _, _) where ex.handledException(val, _, _)

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from RaisingNode r from RaisingNode r
select r.getLocation().getStartLine(), r.toString(), r.getARaisedType().toString() select r.getLocation().getStartLine(), r.toString(), r.getARaisedType().toString()

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ControlFlowNode r, ControlFlowNode s from ControlFlowNode r, ControlFlowNode s
where where

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from RaisingNode r from RaisingNode r
where r.raisesUnknownType() where r.raisesUnknownType()

View File

@@ -1,6 +1,5 @@
import python import python
import semmle.python.pointsto.PointsTo private import LegacyPointsTo
import semmle.python.pointsto.PointsToContext
from ControlFlowNode f, Location l, Context c from ControlFlowNode f, Location l, Context c
where where

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ClassObject cls from ClassObject cls
where not cls.isC() where not cls.isC()

View File

@@ -5,6 +5,7 @@
*/ */
import python import python
private import LegacyPointsTo
from ClassObject cls, int line, string name, Object obj from ClassObject cls, int line, string name, Object obj
where where

View File

@@ -5,6 +5,7 @@
*/ */
import python import python
private import LegacyPointsTo
from ClassObject cls, int line, string name from ClassObject cls, int line, string name
where where

View File

@@ -5,6 +5,7 @@
*/ */
import python import python
private import LegacyPointsTo
from ClassObject cls, string name, Object what from ClassObject cls, string name, Object what
where where

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ClassObject cls, ClassObject l, ClassObject r from ClassObject cls, ClassObject l, ClassObject r
where where

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ModuleObject m, string name from ModuleObject m, string name
where m.getName() = "package" or m.getName() = "confused_elements" where m.getName() = "package" or m.getName() = "confused_elements"

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ModuleObject m, string name from ModuleObject m, string name
where not m.isC() where not m.isC()

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ModuleObject m, string name from ModuleObject m, string name
where not m.isC() and m.exports(name) where not m.isC() and m.exports(name)

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ModuleObject m, string name from ModuleObject m, string name
where not m.isC() and m.importedAs(name) where not m.isC() and m.importedAs(name)

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ModuleValue mv, string usage from ModuleValue mv, string usage
where where

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ClassObject cls from ClassObject cls
where not cls.isC() where not cls.isC()

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ClassObject cls, string style from ClassObject cls, string style
where where

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from RaisingNode r, Scope s, ClassObject cls from RaisingNode r, Scope s, ClassObject cls
where r.viableExceptionalExit_objectapi(s, cls) where r.viableExceptionalExit_objectapi(s, cls)

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from PyFunctionObject f, string type from PyFunctionObject f, string type
where where

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from FunctionObject func, ControlFlowNode call from FunctionObject func, ControlFlowNode call
where func.getACall() = call where func.getACall() = call

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from FunctionObject func from FunctionObject func
where func.neverReturns() where func.neverReturns()

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from PyFunctionObject func, ClassObject ret_type from PyFunctionObject func, ClassObject ret_type
where func.getAnInferredReturnType() = ret_type where func.getAnInferredReturnType() = ret_type

View File

@@ -1,4 +1,5 @@
import python import python
private import LegacyPointsTo
from ClassObject cls, string name, BuiltinPropertyObject p from ClassObject cls, string name, BuiltinPropertyObject p
where where