Skip to content

Commit 810efc5

Browse files
Python: Adds Rasmus's suggestion
Co-Authored-By: Rasmus Wriedt Larsen <[email protected]>
1 parent 3e53e46 commit 810efc5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/ql/src/semmle/python/objects/ObjectAPI.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,9 @@ class ClassValue extends Value {
433433
or
434434
this.getASuperType() = ClassValue::unicode()
435435
or
436-
/* Does this inherit from abc.Sequence? */
437-
this.getASuperType().getName() = "Sequence"
436+
major_version() = 2 and this.getASuperType() = Value::named("collections.Sequence")
437+
or
438+
major_version() = 3 and this.getASuperType() = Value::named("collections.abc.Sequence")
438439
or
439440
/* Does it have an index or __reversed__ method? */
440441
this.isContainer() and

0 commit comments

Comments
 (0)