From 7176898503e02e0bedcc8fd1497e4ca97a256625 Mon Sep 17 00:00:00 2001 From: Taus Date: Thu, 30 Oct 2025 23:10:15 +0000 Subject: [PATCH] Python: Fix library tests --- python/ql/test/library-tests/PointsTo/api/ClassValue.ql | 1 + python/ql/test/library-tests/PointsTo/api/Constants.ql | 1 + python/ql/test/library-tests/PointsTo/api/QualifedNames.ql | 1 + python/ql/test/library-tests/PointsTo/api/Value.ql | 1 + python/ql/test/library-tests/PointsTo/calls/GetACall.ql | 1 + .../test/library-tests/PointsTo/calls/getArgumentForCall.ql | 1 + .../library-tests/PointsTo/calls/getNamedArgumentForCall.ql | 1 + python/ql/test/library-tests/PointsTo/calls/getParameter.ql | 1 + .../test/library-tests/PointsTo/calls/getParameterByName.ql | 1 + python/ql/test/library-tests/PointsTo/decorators/Values.ql | 3 +-- python/ql/test/library-tests/PointsTo/functions/Calls.ql | 1 + .../ql/test/library-tests/PointsTo/functions/NeverReturns.ql | 1 + python/ql/test/library-tests/PointsTo/functions/test.ql | 1 + python/ql/test/library-tests/PointsTo/general/Util.qll | 1 + python/ql/test/library-tests/PointsTo/global/Global.ql | 4 +--- .../ql/test/library-tests/PointsTo/inheritance/BaseTypes.ql | 1 + python/ql/test/library-tests/PointsTo/inheritance/Calls.ql | 1 + python/ql/test/library-tests/PointsTo/inheritance/Declares.ql | 1 + .../ql/test/library-tests/PointsTo/inheritance/MetaClass.ql | 1 + .../ql/test/library-tests/PointsTo/inheritance/SuperTypes.ql | 1 + python/ql/test/library-tests/PointsTo/metaclass/Failed.ql | 1 + python/ql/test/library-tests/PointsTo/metaclass/Style.ql | 1 + python/ql/test/library-tests/PointsTo/metaclass/test.ql | 2 +- python/ql/test/library-tests/PointsTo/new/Call.ql | 1 + python/ql/test/library-tests/PointsTo/new/ClassMethod.ql | 1 + python/ql/test/library-tests/PointsTo/new/NameSpace.ql | 1 + python/ql/test/library-tests/PointsTo/new/PointsToMissing.ql | 2 +- python/ql/test/library-tests/PointsTo/new/PointsToUnknown.ql | 2 +- .../ql/test/library-tests/PointsTo/new/PointsToWithContext.ql | 3 +-- python/ql/test/library-tests/PointsTo/new/PointsToWithType.ql | 2 +- python/ql/test/library-tests/PointsTo/new/Reachable.ql | 2 +- python/ql/test/library-tests/PointsTo/new/SSA.ql | 3 +-- .../test/library-tests/PointsTo/new/SourceEdgeDefinitions.ql | 1 - .../test/library-tests/PointsTo/new/SourceNodeDefinitions.ql | 1 - python/ql/test/library-tests/PointsTo/new/SsaAttr.ql | 3 +-- python/ql/test/library-tests/PointsTo/new/SsaUses.ql | 1 - python/ql/test/library-tests/PointsTo/new/TestEvaluate.ql | 3 +-- python/ql/test/library-tests/PointsTo/new/Util.qll | 2 +- python/ql/test/library-tests/PointsTo/new/VarUses.ql | 2 +- .../PointsTo/regressions/missing/metaclass/getACall.ql | 1 + .../module-imports/conflict-stdlib/LocalModuleWithRef.ql | 1 + .../module-imports/conflict-stdlib/ModuleWithLocalRef.ql | 1 + python/ql/test/library-tests/PointsTo/returns/Test.ql | 1 + python/ql/test/library-tests/PointsTo/subclass/Checks.ql | 2 +- python/ql/test/library-tests/attributes/SelfAttribute.ql | 1 + python/ql/test/library-tests/classes/abstract/Abstract.ql | 1 + python/ql/test/library-tests/classes/attr/class_attr.ql | 1 + .../ql/test/library-tests/classes/attr/class_defined_attr.ql | 1 + .../ql/test/library-tests/classes/attr/class_defines_attr.ql | 1 + python/ql/test/library-tests/classes/attr/class_has_attr.ql | 1 + python/ql/test/library-tests/classes/attr/hash.ql | 1 + python/ql/test/library-tests/classes/mro/C3.ql | 1 + python/ql/test/library-tests/dependencies/Dependencies.ql | 1 + python/ql/test/library-tests/descriptors/Descriptors.ql | 1 + python/ql/test/library-tests/descriptors/Methods.ql | 1 + python/ql/test/library-tests/descriptors/Properties.ql | 1 + python/ql/test/library-tests/exceptions/Handles.ql | 1 + python/ql/test/library-tests/exceptions/Legal.ql | 1 + .../ql/test/library-tests/modules/duplicate_name/Modules.ql | 1 + python/ql/test/library-tests/objects/Name.ql | 1 + python/ql/test/library-tests/overrides/FunctionOverrides.ql | 1 + python/ql/test/library-tests/state_tracking/Test.ql | 1 + python/ql/test/library-tests/taint/config/TaintLib.qll | 1 + python/ql/test/library-tests/taint/config/TaintedArgument.ql | 1 + python/ql/test/library-tests/taint/general/ModuleAttribute.ql | 1 + python/ql/test/library-tests/taint/general/TaintLib.qll | 1 + python/ql/test/library-tests/types/attributes/Test.ql | 1 + .../ql/test/library-tests/types/classattr/ClassAttribute.ql | 1 + python/ql/test/library-tests/types/classattr/ClassMember.ql | 1 + .../ql/test/library-tests/types/classattr/SpecialAttribute.ql | 1 + python/ql/test/library-tests/types/classes/FailedInference.ql | 2 +- python/ql/test/library-tests/types/classes/duplicate_base.ql | 1 + python/ql/test/library-tests/types/exceptions/ExitRaises.ql | 1 + python/ql/test/library-tests/types/exceptions/Handles.ql | 1 + python/ql/test/library-tests/types/exceptions/Impossible.ql | 1 + python/ql/test/library-tests/types/exceptions/LineRaises.ql | 1 + python/ql/test/library-tests/types/exceptions/Raises.ql | 1 + python/ql/test/library-tests/types/exceptions/Reraises.ql | 1 + python/ql/test/library-tests/types/exceptions/Viable.ql | 1 + python/ql/test/library-tests/types/properties/Deleters.ql | 1 + python/ql/test/library-tests/types/properties/Getters.ql | 1 + .../test/library-tests/types/properties/PythonProperties.ql | 1 + python/ql/test/library-tests/types/properties/Setters.ql | 1 + 83 files changed, 80 insertions(+), 25 deletions(-) diff --git a/python/ql/test/library-tests/PointsTo/api/ClassValue.ql b/python/ql/test/library-tests/PointsTo/api/ClassValue.ql index 230cc487ea4..65a4c73d4a6 100644 --- a/python/ql/test/library-tests/PointsTo/api/ClassValue.ql +++ b/python/ql/test/library-tests/PointsTo/api/ClassValue.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassValue cls, string description where diff --git a/python/ql/test/library-tests/PointsTo/api/Constants.ql b/python/ql/test/library-tests/PointsTo/api/Constants.ql index 151f6b9ce9c..a6072a1d8e8 100644 --- a/python/ql/test/library-tests/PointsTo/api/Constants.ql +++ b/python/ql/test/library-tests/PointsTo/api/Constants.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from string txt, Value val where diff --git a/python/ql/test/library-tests/PointsTo/api/QualifedNames.ql b/python/ql/test/library-tests/PointsTo/api/QualifedNames.ql index daafad0492b..c756265295b 100644 --- a/python/ql/test/library-tests/PointsTo/api/QualifedNames.ql +++ b/python/ql/test/library-tests/PointsTo/api/QualifedNames.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from FunctionValue v, string name where diff --git a/python/ql/test/library-tests/PointsTo/api/Value.ql b/python/ql/test/library-tests/PointsTo/api/Value.ql index 9c6e0739461..fadf008f6ea 100644 --- a/python/ql/test/library-tests/PointsTo/api/Value.ql +++ b/python/ql/test/library-tests/PointsTo/api/Value.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from Value val, string name where diff --git a/python/ql/test/library-tests/PointsTo/calls/GetACall.ql b/python/ql/test/library-tests/PointsTo/calls/GetACall.ql index 84f2ab4fb4a..8c6cc76c031 100644 --- a/python/ql/test/library-tests/PointsTo/calls/GetACall.ql +++ b/python/ql/test/library-tests/PointsTo/calls/GetACall.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ControlFlowNode call, Value func where call = func.getACall() diff --git a/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.ql b/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.ql index 7c76b9e0ce5..d388f96783c 100644 --- a/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.ql +++ b/python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from CallNode call, CallableValue callable, int i select call.getLocation().getStartLine(), call.toString(), callable.toString(), i, diff --git a/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.ql b/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.ql index 4cb3fbdf335..7fa39194deb 100644 --- a/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.ql +++ b/python/ql/test/library-tests/PointsTo/calls/getNamedArgumentForCall.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from CallNode call, CallableValue callable, string name select call.getLocation().getStartLine(), call.toString(), callable.toString(), name, diff --git a/python/ql/test/library-tests/PointsTo/calls/getParameter.ql b/python/ql/test/library-tests/PointsTo/calls/getParameter.ql index 07f12cce36f..1cabfeb45bc 100644 --- a/python/ql/test/library-tests/PointsTo/calls/getParameter.ql +++ b/python/ql/test/library-tests/PointsTo/calls/getParameter.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from CallableValue callable, int i select callable.toString(), i, callable.getParameter(i).toString() diff --git a/python/ql/test/library-tests/PointsTo/calls/getParameterByName.ql b/python/ql/test/library-tests/PointsTo/calls/getParameterByName.ql index d4766b680f7..20c4c77f121 100644 --- a/python/ql/test/library-tests/PointsTo/calls/getParameterByName.ql +++ b/python/ql/test/library-tests/PointsTo/calls/getParameterByName.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from CallableValue callable, string name select callable.toString(), name, callable.getParameterByName(name).toString() diff --git a/python/ql/test/library-tests/PointsTo/decorators/Values.ql b/python/ql/test/library-tests/PointsTo/decorators/Values.ql index fc7a08db20b..fe4b6d080f4 100644 --- a/python/ql/test/library-tests/PointsTo/decorators/Values.ql +++ b/python/ql/test/library-tests/PointsTo/decorators/Values.ql @@ -1,6 +1,5 @@ import python -import semmle.python.pointsto.PointsTo -import semmle.python.objects.ObjectInternal +private import LegacyPointsTo from NameNode f, Context ctx, ObjectInternal v where diff --git a/python/ql/test/library-tests/PointsTo/functions/Calls.ql b/python/ql/test/library-tests/PointsTo/functions/Calls.ql index 5bc29b5aaf3..659ba4143f6 100644 --- a/python/ql/test/library-tests/PointsTo/functions/Calls.ql +++ b/python/ql/test/library-tests/PointsTo/functions/Calls.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from CallNode call, FunctionObject func, string kind where diff --git a/python/ql/test/library-tests/PointsTo/functions/NeverReturns.ql b/python/ql/test/library-tests/PointsTo/functions/NeverReturns.ql index c576651a8e6..0a20f8e1b1f 100644 --- a/python/ql/test/library-tests/PointsTo/functions/NeverReturns.ql +++ b/python/ql/test/library-tests/PointsTo/functions/NeverReturns.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from FunctionObject f where f.neverReturns() diff --git a/python/ql/test/library-tests/PointsTo/functions/test.ql b/python/ql/test/library-tests/PointsTo/functions/test.ql index f85e95f5fe4..01f8416c8dc 100644 --- a/python/ql/test/library-tests/PointsTo/functions/test.ql +++ b/python/ql/test/library-tests/PointsTo/functions/test.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from Call c, FunctionObject f where diff --git a/python/ql/test/library-tests/PointsTo/general/Util.qll b/python/ql/test/library-tests/PointsTo/general/Util.qll index 1c26d7d830b..289e71a9e6c 100644 --- a/python/ql/test/library-tests/PointsTo/general/Util.qll +++ b/python/ql/test/library-tests/PointsTo/general/Util.qll @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo string repr(Object o) { not o instanceof StringObject and not o = theBoundMethodType() and result = o.toString() diff --git a/python/ql/test/library-tests/PointsTo/global/Global.ql b/python/ql/test/library-tests/PointsTo/global/Global.ql index f9f52b12641..4dc6d16d379 100644 --- a/python/ql/test/library-tests/PointsTo/global/Global.ql +++ b/python/ql/test/library-tests/PointsTo/global/Global.ql @@ -1,7 +1,5 @@ import python -import semmle.python.pointsto.PointsTo -import semmle.python.pointsto.PointsToContext -import semmle.python.objects.ObjectInternal +private import LegacyPointsTo from ControlFlowNode f, PointsToContext ctx, Value obj, ControlFlowNode orig where diff --git a/python/ql/test/library-tests/PointsTo/inheritance/BaseTypes.ql b/python/ql/test/library-tests/PointsTo/inheritance/BaseTypes.ql index f1201eba0dc..01f69d8bb12 100644 --- a/python/ql/test/library-tests/PointsTo/inheritance/BaseTypes.ql +++ b/python/ql/test/library-tests/PointsTo/inheritance/BaseTypes.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, ClassObject base, int n where diff --git a/python/ql/test/library-tests/PointsTo/inheritance/Calls.ql b/python/ql/test/library-tests/PointsTo/inheritance/Calls.ql index f91d207fc70..3f111d6e08a 100644 --- a/python/ql/test/library-tests/PointsTo/inheritance/Calls.ql +++ b/python/ql/test/library-tests/PointsTo/inheritance/Calls.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from Call c, FunctionObject f where f.getACall().getNode() = c diff --git a/python/ql/test/library-tests/PointsTo/inheritance/Declares.ql b/python/ql/test/library-tests/PointsTo/inheritance/Declares.ql index a2c762be860..2fe61ca2d7f 100644 --- a/python/ql/test/library-tests/PointsTo/inheritance/Declares.ql +++ b/python/ql/test/library-tests/PointsTo/inheritance/Declares.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, string name where class_declares_attribute(cls, name) diff --git a/python/ql/test/library-tests/PointsTo/inheritance/MetaClass.ql b/python/ql/test/library-tests/PointsTo/inheritance/MetaClass.ql index 0ca90782119..a487c16e953 100644 --- a/python/ql/test/library-tests/PointsTo/inheritance/MetaClass.ql +++ b/python/ql/test/library-tests/PointsTo/inheritance/MetaClass.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, ClassObject meta where diff --git a/python/ql/test/library-tests/PointsTo/inheritance/SuperTypes.ql b/python/ql/test/library-tests/PointsTo/inheritance/SuperTypes.ql index 338ea118ac1..c3156eb1fa0 100644 --- a/python/ql/test/library-tests/PointsTo/inheritance/SuperTypes.ql +++ b/python/ql/test/library-tests/PointsTo/inheritance/SuperTypes.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, ClassObject sup where diff --git a/python/ql/test/library-tests/PointsTo/metaclass/Failed.ql b/python/ql/test/library-tests/PointsTo/metaclass/Failed.ql index a5d2afd4241..4129c99666b 100644 --- a/python/ql/test/library-tests/PointsTo/metaclass/Failed.ql +++ b/python/ql/test/library-tests/PointsTo/metaclass/Failed.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, string reason where diff --git a/python/ql/test/library-tests/PointsTo/metaclass/Style.ql b/python/ql/test/library-tests/PointsTo/metaclass/Style.ql index f29ba3a8b7c..7ab5b4a329f 100644 --- a/python/ql/test/library-tests/PointsTo/metaclass/Style.ql +++ b/python/ql/test/library-tests/PointsTo/metaclass/Style.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, string style where diff --git a/python/ql/test/library-tests/PointsTo/metaclass/test.ql b/python/ql/test/library-tests/PointsTo/metaclass/test.ql index d08f4e37fa6..471c01599d6 100644 --- a/python/ql/test/library-tests/PointsTo/metaclass/test.ql +++ b/python/ql/test/library-tests/PointsTo/metaclass/test.ql @@ -1,5 +1,5 @@ import python -private import semmle.python.objects.ObjectInternal +private import LegacyPointsTo /** An unknown type. Not usually visible. */ class UnknownType extends UnknownClassInternal { diff --git a/python/ql/test/library-tests/PointsTo/new/Call.ql b/python/ql/test/library-tests/PointsTo/new/Call.ql index f014001f315..e924398ca40 100644 --- a/python/ql/test/library-tests/PointsTo/new/Call.ql +++ b/python/ql/test/library-tests/PointsTo/new/Call.ql @@ -1,5 +1,6 @@ import python import Util +private import LegacyPointsTo from ControlFlowNode call, FunctionObject func where call = func.getACall() diff --git a/python/ql/test/library-tests/PointsTo/new/ClassMethod.ql b/python/ql/test/library-tests/PointsTo/new/ClassMethod.ql index 17f73420e05..9eac6e3fea2 100644 --- a/python/ql/test/library-tests/PointsTo/new/ClassMethod.ql +++ b/python/ql/test/library-tests/PointsTo/new/ClassMethod.ql @@ -1,5 +1,6 @@ import python import Util +private import LegacyPointsTo from ClassMethodObject cm, CallNode call where call = cm.getACall() diff --git a/python/ql/test/library-tests/PointsTo/new/NameSpace.ql b/python/ql/test/library-tests/PointsTo/new/NameSpace.ql index 5d099f78b61..6150b94aee1 100644 --- a/python/ql/test/library-tests/PointsTo/new/NameSpace.ql +++ b/python/ql/test/library-tests/PointsTo/new/NameSpace.ql @@ -1,5 +1,6 @@ import python import Util +private import LegacyPointsTo from Scope s, string name, Object val where diff --git a/python/ql/test/library-tests/PointsTo/new/PointsToMissing.ql b/python/ql/test/library-tests/PointsTo/new/PointsToMissing.ql index 9e744591df2..271f35db996 100644 --- a/python/ql/test/library-tests/PointsTo/new/PointsToMissing.ql +++ b/python/ql/test/library-tests/PointsTo/new/PointsToMissing.ql @@ -1,6 +1,6 @@ import python import Util -import semmle.python.pointsto.PointsTo +private import LegacyPointsTo /* This test should return _no_ results. */ predicate relevant_node(ControlFlowNode n) { diff --git a/python/ql/test/library-tests/PointsTo/new/PointsToUnknown.ql b/python/ql/test/library-tests/PointsTo/new/PointsToUnknown.ql index cb91e18dafe..2526819b76a 100644 --- a/python/ql/test/library-tests/PointsTo/new/PointsToUnknown.ql +++ b/python/ql/test/library-tests/PointsTo/new/PointsToUnknown.ql @@ -1,6 +1,6 @@ import python import Util -import semmle.python.pointsto.PointsTo +private import LegacyPointsTo from ControlFlowNode f, ControlFlowNode x where PointsTo::pointsTo(f, _, ObjectInternal::unknown(), x) diff --git a/python/ql/test/library-tests/PointsTo/new/PointsToWithContext.ql b/python/ql/test/library-tests/PointsTo/new/PointsToWithContext.ql index dbed1a9a7f6..bad7589d0a2 100644 --- a/python/ql/test/library-tests/PointsTo/new/PointsToWithContext.ql +++ b/python/ql/test/library-tests/PointsTo/new/PointsToWithContext.ql @@ -1,7 +1,6 @@ import python import Util -import semmle.python.pointsto.PointsTo -import semmle.python.pointsto.PointsToContext +private import LegacyPointsTo from ControlFlowNode f, Object o, ClassObject c, ControlFlowNode x, PointsToContext ctx where PointsTo::points_to(f, ctx, o, c, x) diff --git a/python/ql/test/library-tests/PointsTo/new/PointsToWithType.ql b/python/ql/test/library-tests/PointsTo/new/PointsToWithType.ql index 5747ce18fd5..20a23abced7 100644 --- a/python/ql/test/library-tests/PointsTo/new/PointsToWithType.ql +++ b/python/ql/test/library-tests/PointsTo/new/PointsToWithType.ql @@ -1,6 +1,6 @@ import python import Util -import semmle.python.pointsto.PointsTo +private import LegacyPointsTo from ControlFlowNode f, Object o, ClassObject c, ControlFlowNode x where PointsTo::points_to(f, _, o, c, x) diff --git a/python/ql/test/library-tests/PointsTo/new/Reachable.ql b/python/ql/test/library-tests/PointsTo/new/Reachable.ql index f8b2f0585eb..2376f13c752 100644 --- a/python/ql/test/library-tests/PointsTo/new/Reachable.ql +++ b/python/ql/test/library-tests/PointsTo/new/Reachable.ql @@ -1,5 +1,5 @@ import python -private import semmle.python.pointsto.PointsTo +private import LegacyPointsTo import Util from ControlFlowNode f, Context ctx diff --git a/python/ql/test/library-tests/PointsTo/new/SSA.ql b/python/ql/test/library-tests/PointsTo/new/SSA.ql index 7b41f3c427e..c919e1d4856 100644 --- a/python/ql/test/library-tests/PointsTo/new/SSA.ql +++ b/python/ql/test/library-tests/PointsTo/new/SSA.ql @@ -1,6 +1,5 @@ import python -private import semmle.python.pointsto.PointsTo -private import semmle.python.pointsto.PointsToContext +private import LegacyPointsTo import Util predicate ssa_variable_points_to( diff --git a/python/ql/test/library-tests/PointsTo/new/SourceEdgeDefinitions.ql b/python/ql/test/library-tests/PointsTo/new/SourceEdgeDefinitions.ql index 8cf0b4c15a6..117afe8100e 100644 --- a/python/ql/test/library-tests/PointsTo/new/SourceEdgeDefinitions.ql +++ b/python/ql/test/library-tests/PointsTo/new/SourceEdgeDefinitions.ql @@ -1,5 +1,4 @@ import python -import semmle.python.pointsto.PointsTo import Util from SsaSourceVariable var, ControlFlowNode use, BasicBlock pred diff --git a/python/ql/test/library-tests/PointsTo/new/SourceNodeDefinitions.ql b/python/ql/test/library-tests/PointsTo/new/SourceNodeDefinitions.ql index 77f6ab0923b..2c5867f9c4f 100644 --- a/python/ql/test/library-tests/PointsTo/new/SourceNodeDefinitions.ql +++ b/python/ql/test/library-tests/PointsTo/new/SourceNodeDefinitions.ql @@ -1,5 +1,4 @@ import python -import semmle.python.pointsto.PointsTo import Util from SsaSourceVariable var, ControlFlowNode defn, string kind diff --git a/python/ql/test/library-tests/PointsTo/new/SsaAttr.ql b/python/ql/test/library-tests/PointsTo/new/SsaAttr.ql index 67d85c2e3bd..c9b136f0c02 100644 --- a/python/ql/test/library-tests/PointsTo/new/SsaAttr.ql +++ b/python/ql/test/library-tests/PointsTo/new/SsaAttr.ql @@ -1,6 +1,5 @@ import python -private import semmle.python.pointsto.PointsTo -private import semmle.python.objects.ObjectInternal +private import LegacyPointsTo import Util from EssaVariable var, string name, ObjectInternal o, Context ctx diff --git a/python/ql/test/library-tests/PointsTo/new/SsaUses.ql b/python/ql/test/library-tests/PointsTo/new/SsaUses.ql index 2a8e8f1e750..9a250b6610f 100644 --- a/python/ql/test/library-tests/PointsTo/new/SsaUses.ql +++ b/python/ql/test/library-tests/PointsTo/new/SsaUses.ql @@ -1,5 +1,4 @@ import python -import semmle.python.pointsto.PointsTo import Util from EssaVariable var, ControlFlowNode use diff --git a/python/ql/test/library-tests/PointsTo/new/TestEvaluate.ql b/python/ql/test/library-tests/PointsTo/new/TestEvaluate.ql index d473e4e804a..1132f04df07 100644 --- a/python/ql/test/library-tests/PointsTo/new/TestEvaluate.ql +++ b/python/ql/test/library-tests/PointsTo/new/TestEvaluate.ql @@ -1,6 +1,5 @@ import python -import semmle.python.pointsto.PointsTo -import semmle.python.pointsto.PointsToContext +private import LegacyPointsTo import Util from diff --git a/python/ql/test/library-tests/PointsTo/new/Util.qll b/python/ql/test/library-tests/PointsTo/new/Util.qll index b83ad89d1c8..23c5aa8df7c 100644 --- a/python/ql/test/library-tests/PointsTo/new/Util.qll +++ b/python/ql/test/library-tests/PointsTo/new/Util.qll @@ -1,5 +1,5 @@ import python -import semmle.python.objects.ObjectInternal +private import LegacyPointsTo bindingset[which] string locate(Location l, string which) { diff --git a/python/ql/test/library-tests/PointsTo/new/VarUses.ql b/python/ql/test/library-tests/PointsTo/new/VarUses.ql index 58de54d7a3d..50b07d03be0 100644 --- a/python/ql/test/library-tests/PointsTo/new/VarUses.ql +++ b/python/ql/test/library-tests/PointsTo/new/VarUses.ql @@ -1,5 +1,5 @@ import python -import semmle.python.pointsto.PointsTo +private import LegacyPointsTo import Util from SsaSourceVariable var, ControlFlowNode use diff --git a/python/ql/test/library-tests/PointsTo/regressions/missing/metaclass/getACall.ql b/python/ql/test/library-tests/PointsTo/regressions/missing/metaclass/getACall.ql index e555c927d6a..5ca3c9518d6 100644 --- a/python/ql/test/library-tests/PointsTo/regressions/missing/metaclass/getACall.ql +++ b/python/ql/test/library-tests/PointsTo/regressions/missing/metaclass/getACall.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PythonFunctionValue func select func, func.getACall() diff --git a/python/ql/test/library-tests/PointsTo/regressions/wrong/module-imports/conflict-stdlib/LocalModuleWithRef.ql b/python/ql/test/library-tests/PointsTo/regressions/wrong/module-imports/conflict-stdlib/LocalModuleWithRef.ql index 5bdb99415b2..f6bc97bf1f0 100644 --- a/python/ql/test/library-tests/PointsTo/regressions/wrong/module-imports/conflict-stdlib/LocalModuleWithRef.ql +++ b/python/ql/test/library-tests/PointsTo/regressions/wrong/module-imports/conflict-stdlib/LocalModuleWithRef.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ModuleValue mv, ControlFlowNode ref, string local_external where diff --git a/python/ql/test/library-tests/PointsTo/regressions/wrong/module-imports/conflict-stdlib/ModuleWithLocalRef.ql b/python/ql/test/library-tests/PointsTo/regressions/wrong/module-imports/conflict-stdlib/ModuleWithLocalRef.ql index 030211ba0bf..1422d5731fd 100644 --- a/python/ql/test/library-tests/PointsTo/regressions/wrong/module-imports/conflict-stdlib/ModuleWithLocalRef.ql +++ b/python/ql/test/library-tests/PointsTo/regressions/wrong/module-imports/conflict-stdlib/ModuleWithLocalRef.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ModuleValue mv, ControlFlowNode ref, string in_stdlib, string local_external, string is_missing where diff --git a/python/ql/test/library-tests/PointsTo/returns/Test.ql b/python/ql/test/library-tests/PointsTo/returns/Test.ql index 8546de90f24..928e4c9672f 100644 --- a/python/ql/test/library-tests/PointsTo/returns/Test.ql +++ b/python/ql/test/library-tests/PointsTo/returns/Test.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PyFunctionObject f select f.toString(), f.getAnInferredReturnType().toString() diff --git a/python/ql/test/library-tests/PointsTo/subclass/Checks.ql b/python/ql/test/library-tests/PointsTo/subclass/Checks.ql index a82002b1d5f..f9deaabbc88 100644 --- a/python/ql/test/library-tests/PointsTo/subclass/Checks.ql +++ b/python/ql/test/library-tests/PointsTo/subclass/Checks.ql @@ -1,5 +1,5 @@ import python -import semmle.python.pointsto.PointsTo +private import LegacyPointsTo from Value sup, Value cls where Expressions::requireSubClass(cls, sup) diff --git a/python/ql/test/library-tests/attributes/SelfAttribute.ql b/python/ql/test/library-tests/attributes/SelfAttribute.ql index 66993121241..79ceff3a08a 100644 --- a/python/ql/test/library-tests/attributes/SelfAttribute.ql +++ b/python/ql/test/library-tests/attributes/SelfAttribute.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from SelfAttributeRead sa, int line, string g, string l where diff --git a/python/ql/test/library-tests/classes/abstract/Abstract.ql b/python/ql/test/library-tests/classes/abstract/Abstract.ql index bd2f98034cb..02c76421126 100644 --- a/python/ql/test/library-tests/classes/abstract/Abstract.ql +++ b/python/ql/test/library-tests/classes/abstract/Abstract.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, string abstract where diff --git a/python/ql/test/library-tests/classes/attr/class_attr.ql b/python/ql/test/library-tests/classes/attr/class_attr.ql index 197ab1a1e5e..1c9c5513a1d 100644 --- a/python/ql/test/library-tests/classes/attr/class_attr.ql +++ b/python/ql/test/library-tests/classes/attr/class_attr.ql @@ -5,6 +5,7 @@ */ import python +private import LegacyPointsTo from ClassObject cls, int line, string name, Object obj where diff --git a/python/ql/test/library-tests/classes/attr/class_defined_attr.ql b/python/ql/test/library-tests/classes/attr/class_defined_attr.ql index d7583e689c4..4fc6f7b67d2 100644 --- a/python/ql/test/library-tests/classes/attr/class_defined_attr.ql +++ b/python/ql/test/library-tests/classes/attr/class_defined_attr.ql @@ -5,6 +5,7 @@ */ import python +private import LegacyPointsTo from ClassObject cls, int line, string name, Object obj where diff --git a/python/ql/test/library-tests/classes/attr/class_defines_attr.ql b/python/ql/test/library-tests/classes/attr/class_defines_attr.ql index 6b266a0d40f..71dee836a9f 100644 --- a/python/ql/test/library-tests/classes/attr/class_defines_attr.ql +++ b/python/ql/test/library-tests/classes/attr/class_defines_attr.ql @@ -5,6 +5,7 @@ */ import python +private import LegacyPointsTo from ClassObject cls, int line, string name where diff --git a/python/ql/test/library-tests/classes/attr/class_has_attr.ql b/python/ql/test/library-tests/classes/attr/class_has_attr.ql index be8272d1bd6..24724f4d859 100644 --- a/python/ql/test/library-tests/classes/attr/class_has_attr.ql +++ b/python/ql/test/library-tests/classes/attr/class_has_attr.ql @@ -5,6 +5,7 @@ */ import python +private import LegacyPointsTo from ClassObject cls, int line, string name where diff --git a/python/ql/test/library-tests/classes/attr/hash.ql b/python/ql/test/library-tests/classes/attr/hash.ql index 19ac8933f69..3708e62ccdd 100644 --- a/python/ql/test/library-tests/classes/attr/hash.ql +++ b/python/ql/test/library-tests/classes/attr/hash.ql @@ -5,6 +5,7 @@ */ import python +private import LegacyPointsTo from ClassObject cls, int line, Object obj where diff --git a/python/ql/test/library-tests/classes/mro/C3.ql b/python/ql/test/library-tests/classes/mro/C3.ql index 981a55893c2..60b4b0c1e1b 100644 --- a/python/ql/test/library-tests/classes/mro/C3.ql +++ b/python/ql/test/library-tests/classes/mro/C3.ql @@ -1,5 +1,6 @@ import python import semmle.python.pointsto.MRO +private import LegacyPointsTo from ClassValue cls where not cls.isBuiltin() diff --git a/python/ql/test/library-tests/dependencies/Dependencies.ql b/python/ql/test/library-tests/dependencies/Dependencies.ql index 12378a567d2..6f0f6cb3bb7 100644 --- a/python/ql/test/library-tests/dependencies/Dependencies.ql +++ b/python/ql/test/library-tests/dependencies/Dependencies.ql @@ -1,5 +1,6 @@ import python import semmle.python.dependencies.Dependencies +private import LegacyPointsTo from DependencyKind dk, AstNode src, Object target where dk.isADependency(src, target) diff --git a/python/ql/test/library-tests/descriptors/Descriptors.ql b/python/ql/test/library-tests/descriptors/Descriptors.ql index e577d47b421..7a0f196f3f6 100644 --- a/python/ql/test/library-tests/descriptors/Descriptors.ql +++ b/python/ql/test/library-tests/descriptors/Descriptors.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, string kind where diff --git a/python/ql/test/library-tests/descriptors/Methods.ql b/python/ql/test/library-tests/descriptors/Methods.ql index 3761ec5f7b5..49c8a3bbbff 100644 --- a/python/ql/test/library-tests/descriptors/Methods.ql +++ b/python/ql/test/library-tests/descriptors/Methods.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo int lineof(Object o) { result = o.getOrigin().getLocation().getStartLine() } diff --git a/python/ql/test/library-tests/descriptors/Properties.ql b/python/ql/test/library-tests/descriptors/Properties.ql index 29f9e2577a0..349d0a242f9 100644 --- a/python/ql/test/library-tests/descriptors/Properties.ql +++ b/python/ql/test/library-tests/descriptors/Properties.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PropertyValue p, string method_name, FunctionValue method where diff --git a/python/ql/test/library-tests/exceptions/Handles.ql b/python/ql/test/library-tests/exceptions/Handles.ql index 620944de5b9..60989ff8645 100644 --- a/python/ql/test/library-tests/exceptions/Handles.ql +++ b/python/ql/test/library-tests/exceptions/Handles.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ExceptFlowNode ex, Value val where ex.handledException(val, _, _) diff --git a/python/ql/test/library-tests/exceptions/Legal.ql b/python/ql/test/library-tests/exceptions/Legal.ql index bfe47717d23..5b10854c1e1 100644 --- a/python/ql/test/library-tests/exceptions/Legal.ql +++ b/python/ql/test/library-tests/exceptions/Legal.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, string legal where diff --git a/python/ql/test/library-tests/modules/duplicate_name/Modules.ql b/python/ql/test/library-tests/modules/duplicate_name/Modules.ql index a6477c7d6af..af3df6f6eca 100644 --- a/python/ql/test/library-tests/modules/duplicate_name/Modules.ql +++ b/python/ql/test/library-tests/modules/duplicate_name/Modules.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from string name, int mcnt where mcnt = strictcount(Module m | m.getName() = name) and mcnt > 1 diff --git a/python/ql/test/library-tests/objects/Name.ql b/python/ql/test/library-tests/objects/Name.ql index c274ed34554..e4bac8bba65 100644 --- a/python/ql/test/library-tests/objects/Name.ql +++ b/python/ql/test/library-tests/objects/Name.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from Object o, string name where diff --git a/python/ql/test/library-tests/overrides/FunctionOverrides.ql b/python/ql/test/library-tests/overrides/FunctionOverrides.ql index c719006665d..a30ca89d6cc 100644 --- a/python/ql/test/library-tests/overrides/FunctionOverrides.ql +++ b/python/ql/test/library-tests/overrides/FunctionOverrides.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PythonFunctionValue f, string overriding, string overridden where diff --git a/python/ql/test/library-tests/state_tracking/Test.ql b/python/ql/test/library-tests/state_tracking/Test.ql index a0a12e8615d..706dc73191a 100644 --- a/python/ql/test/library-tests/state_tracking/Test.ql +++ b/python/ql/test/library-tests/state_tracking/Test.ql @@ -1,5 +1,6 @@ import python import Lib +private import LegacyPointsTo from ControlFlowNode f, TrackableState state, Context ctx, boolean sense where diff --git a/python/ql/test/library-tests/taint/config/TaintLib.qll b/python/ql/test/library-tests/taint/config/TaintLib.qll index 35eebe8ffa6..82bc4afa72e 100644 --- a/python/ql/test/library-tests/taint/config/TaintLib.qll +++ b/python/ql/test/library-tests/taint/config/TaintLib.qll @@ -1,5 +1,6 @@ import python import semmle.python.dataflow.TaintTracking +private import LegacyPointsTo class SimpleTest extends TaintKind { SimpleTest() { this = "simple.test" } diff --git a/python/ql/test/library-tests/taint/config/TaintedArgument.ql b/python/ql/test/library-tests/taint/config/TaintedArgument.ql index b8753b3fe00..e3689bca0d8 100644 --- a/python/ql/test/library-tests/taint/config/TaintedArgument.ql +++ b/python/ql/test/library-tests/taint/config/TaintedArgument.ql @@ -2,6 +2,7 @@ import python import semmle.python.dataflow.TaintTracking import TaintLib import semmle.python.dataflow.Implementation +private import LegacyPointsTo from TaintTrackingImplementation config, TaintTrackingNode src, CallNode call, diff --git a/python/ql/test/library-tests/taint/general/ModuleAttribute.ql b/python/ql/test/library-tests/taint/general/ModuleAttribute.ql index 6a4349b4100..8da8cb5048e 100644 --- a/python/ql/test/library-tests/taint/general/ModuleAttribute.ql +++ b/python/ql/test/library-tests/taint/general/ModuleAttribute.ql @@ -1,6 +1,7 @@ import python import semmle.python.dataflow.Implementation import TaintLib +private import LegacyPointsTo from ModuleValue m, string name, TaintedNode origin, TaintTrackingImplementation impl where impl.moduleAttributeTainted(m, name, origin) diff --git a/python/ql/test/library-tests/taint/general/TaintLib.qll b/python/ql/test/library-tests/taint/general/TaintLib.qll index af3799c3b95..eb55093ad09 100644 --- a/python/ql/test/library-tests/taint/general/TaintLib.qll +++ b/python/ql/test/library-tests/taint/general/TaintLib.qll @@ -1,5 +1,6 @@ import python import semmle.python.dataflow.TaintTracking +private import LegacyPointsTo class SimpleTest extends TaintKind { SimpleTest() { this = "simple.test" } diff --git a/python/ql/test/library-tests/types/attributes/Test.ql b/python/ql/test/library-tests/types/attributes/Test.ql index 9e066a6414b..ba2e8995dc2 100644 --- a/python/ql/test/library-tests/types/attributes/Test.ql +++ b/python/ql/test/library-tests/types/attributes/Test.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, ClassObject start, string name, Object val where not name.substring(0, 2) = "__" and val = cls.lookupMro(start, name) diff --git a/python/ql/test/library-tests/types/classattr/ClassAttribute.ql b/python/ql/test/library-tests/types/classattr/ClassAttribute.ql index d0633a36e3a..fc775ebf39b 100644 --- a/python/ql/test/library-tests/types/classattr/ClassAttribute.ql +++ b/python/ql/test/library-tests/types/classattr/ClassAttribute.ql @@ -5,6 +5,7 @@ */ import python +private import LegacyPointsTo from ClassObject cls, string name, string kind where diff --git a/python/ql/test/library-tests/types/classattr/ClassMember.ql b/python/ql/test/library-tests/types/classattr/ClassMember.ql index d1e136a5108..54f1d1a5b02 100644 --- a/python/ql/test/library-tests/types/classattr/ClassMember.ql +++ b/python/ql/test/library-tests/types/classattr/ClassMember.ql @@ -5,6 +5,7 @@ */ import python +private import LegacyPointsTo from ClassObject cls, string name, string kind, Object o where diff --git a/python/ql/test/library-tests/types/classattr/SpecialAttribute.ql b/python/ql/test/library-tests/types/classattr/SpecialAttribute.ql index dc21b250c1e..375e9b9880e 100644 --- a/python/ql/test/library-tests/types/classattr/SpecialAttribute.ql +++ b/python/ql/test/library-tests/types/classattr/SpecialAttribute.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls, string name, string kind, Object o where diff --git a/python/ql/test/library-tests/types/classes/FailedInference.ql b/python/ql/test/library-tests/types/classes/FailedInference.ql index 192cf696fbf..feae8fdc5ee 100644 --- a/python/ql/test/library-tests/types/classes/FailedInference.ql +++ b/python/ql/test/library-tests/types/classes/FailedInference.ql @@ -1,5 +1,5 @@ import python -import semmle.python.pointsto.PointsTo +private import LegacyPointsTo from ClassValue cls, string reason where Types::failedInference(cls, reason) diff --git a/python/ql/test/library-tests/types/classes/duplicate_base.ql b/python/ql/test/library-tests/types/classes/duplicate_base.ql index 47e975c4560..7a32b545ae0 100644 --- a/python/ql/test/library-tests/types/classes/duplicate_base.ql +++ b/python/ql/test/library-tests/types/classes/duplicate_base.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ClassObject cls where cls.hasDuplicateBases() diff --git a/python/ql/test/library-tests/types/exceptions/ExitRaises.ql b/python/ql/test/library-tests/types/exceptions/ExitRaises.ql index 32ef268332c..6ad248f6612 100644 --- a/python/ql/test/library-tests/types/exceptions/ExitRaises.ql +++ b/python/ql/test/library-tests/types/exceptions/ExitRaises.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from RaisingNode r, Scope s, ClassObject cls where r.viableExceptionalExit_objectapi(s, cls) diff --git a/python/ql/test/library-tests/types/exceptions/Handles.ql b/python/ql/test/library-tests/types/exceptions/Handles.ql index dfdf1f9d7b2..e5a21724975 100644 --- a/python/ql/test/library-tests/types/exceptions/Handles.ql +++ b/python/ql/test/library-tests/types/exceptions/Handles.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ExceptFlowNode n, ClassObject cls where n.handles_objectapi(cls) diff --git a/python/ql/test/library-tests/types/exceptions/Impossible.ql b/python/ql/test/library-tests/types/exceptions/Impossible.ql index 787ba8898f9..acdcbb8e84f 100644 --- a/python/ql/test/library-tests/types/exceptions/Impossible.ql +++ b/python/ql/test/library-tests/types/exceptions/Impossible.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from RaisingNode r, ControlFlowNode n, string kind where diff --git a/python/ql/test/library-tests/types/exceptions/LineRaises.ql b/python/ql/test/library-tests/types/exceptions/LineRaises.ql index de8b834e520..94b54a27198 100644 --- a/python/ql/test/library-tests/types/exceptions/LineRaises.ql +++ b/python/ql/test/library-tests/types/exceptions/LineRaises.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from RaisingNode r, string type where diff --git a/python/ql/test/library-tests/types/exceptions/Raises.ql b/python/ql/test/library-tests/types/exceptions/Raises.ql index 2415c707967..e4f9a6664d5 100644 --- a/python/ql/test/library-tests/types/exceptions/Raises.ql +++ b/python/ql/test/library-tests/types/exceptions/Raises.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PyFunctionObject f, string type where diff --git a/python/ql/test/library-tests/types/exceptions/Reraises.ql b/python/ql/test/library-tests/types/exceptions/Reraises.ql index 699eb325f8c..8a6ade33d5a 100644 --- a/python/ql/test/library-tests/types/exceptions/Reraises.ql +++ b/python/ql/test/library-tests/types/exceptions/Reraises.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from ReraisingNode r select r.getLocation().getStartLine(), r, r.getARaisedType().toString() diff --git a/python/ql/test/library-tests/types/exceptions/Viable.ql b/python/ql/test/library-tests/types/exceptions/Viable.ql index bf00a0675d6..589e2630bb9 100644 --- a/python/ql/test/library-tests/types/exceptions/Viable.ql +++ b/python/ql/test/library-tests/types/exceptions/Viable.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from RaisingNode r, ControlFlowNode n, ClassObject ex where r.viableExceptionEdge_objectapi(n, ex) diff --git a/python/ql/test/library-tests/types/properties/Deleters.ql b/python/ql/test/library-tests/types/properties/Deleters.ql index ad99ceb387d..ed98d02b3a8 100644 --- a/python/ql/test/library-tests/types/properties/Deleters.ql +++ b/python/ql/test/library-tests/types/properties/Deleters.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PythonPropertyObject p select p.toString(), p.getDeleter().toString() diff --git a/python/ql/test/library-tests/types/properties/Getters.ql b/python/ql/test/library-tests/types/properties/Getters.ql index 5f232858696..d8c54dbda09 100644 --- a/python/ql/test/library-tests/types/properties/Getters.ql +++ b/python/ql/test/library-tests/types/properties/Getters.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PythonPropertyObject p select p.toString(), p.getGetter().toString() diff --git a/python/ql/test/library-tests/types/properties/PythonProperties.ql b/python/ql/test/library-tests/types/properties/PythonProperties.ql index 858326d6ac0..4440c6df21e 100644 --- a/python/ql/test/library-tests/types/properties/PythonProperties.ql +++ b/python/ql/test/library-tests/types/properties/PythonProperties.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PythonPropertyObject p select p.toString() diff --git a/python/ql/test/library-tests/types/properties/Setters.ql b/python/ql/test/library-tests/types/properties/Setters.ql index 871e6f9145f..5180f58552a 100644 --- a/python/ql/test/library-tests/types/properties/Setters.ql +++ b/python/ql/test/library-tests/types/properties/Setters.ql @@ -1,4 +1,5 @@ import python +private import LegacyPointsTo from PythonPropertyObject p select p.toString(), p.getSetter().toString()