Skip to content

Commit 5b63b49

Browse files
committed
Python: Fix query tests
Mostly just adding `private import LegacyPointsTo`. Sometimes getting rid of other imports that are superceded by that module.
1 parent 2732a65 commit 5b63b49

File tree

52 files changed

+49
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+49
-16
lines changed

python/ql/src/Classes/ClassAttributes.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import python
2-
private import semmle.python.pointsto.PointsTo
2+
private import LegacyPointsTo
33

44
/** A helper class for UndefinedClassAttribute.ql and MaybeUndefinedClassAttribute.ql */
55
class CheckClass extends ClassObject {

python/ql/src/Classes/ConflictingAttributesInBaseClasses.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import python
15+
private import LegacyPointsTo
1516

1617
predicate does_nothing(PyFunctionObject f) {
1718
not exists(Stmt s | s.getScope() = f.getFunction() |

python/ql/src/Classes/DefineEqualsWhenAddingAttributes.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
import python
1515
import Equality
16+
private import LegacyPointsTo
1617

1718
predicate class_stores_to_attribute(ClassValue cls, SelfAttributeStore store, string name) {
1819
exists(FunctionValue f |

python/ql/src/Classes/InconsistentMRO.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import python
15+
private import LegacyPointsTo
1516

1617
ClassObject left_base(ClassObject type, ClassObject base) {
1718
exists(int i | i > 0 and type.getBaseType(i) = base and result = type.getBaseType(i - 1))

python/ql/src/Classes/MaybeUndefinedClassAttribute.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import python
1414
import ClassAttributes
15+
private import LegacyPointsTo
1516

1617
predicate guarded_by_other_attribute(SelfAttributeRead a, CheckClass c) {
1718
c.sometimesDefines(a.getName()) and

python/ql/src/Classes/MutatingDescriptor.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import python
15+
private import LegacyPointsTo
1516

1617
predicate mutates_descriptor(ClassObject cls, SelfAttributeStore s) {
1718
cls.isDescriptorType() and

python/ql/src/Classes/OverwritingAttributeInSuperClass.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import python
15+
private import LegacyPointsTo
1516

1617
class InitCallStmt extends ExprStmt {
1718
InitCallStmt() {

python/ql/src/Classes/PropertyInOldStyleClass.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
import python
14+
private import LegacyPointsTo
1415

1516
from PropertyObject prop, ClassObject cls
1617
where cls.declaredAttribute(_) = prop and not cls.failedInference() and not cls.isNewStyle()

python/ql/src/Classes/ShouldBeContextManager.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*/
1515

1616
import python
17+
private import LegacyPointsTo
1718

1819
from ClassValue c
1920
where not c.isBuiltin() and not c.isContextManager() and exists(c.declaredAttribute("__del__"))

python/ql/src/Classes/SlotsInOldStyleClass.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import python
15+
private import LegacyPointsTo
1516

1617
from ClassObject c
1718
where not c.isNewStyle() and c.declaresAttribute("__slots__") and not c.failedInference()

0 commit comments

Comments
 (0)